Skip to content

Rotki Development Builds #307

Rotki Development Builds

Rotki Development Builds #307

name: Rotki Development Builds
on:
schedule:
- cron: "0 0 * * *"
push:
branches:
- build
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
PYTHON_MACOS: 11
jobs:
build-linux:
name: Build linux binary
if: ${{ github.repository == 'rotki/rotki' || github.event_name != 'schedule' }}
env:
CI: true
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Load env
uses: rotki/action-env@v2
with:
env_file: .github/.env.ci
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: 'frontend/.nvmrc'
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
package_json_file: frontend/package.json
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
frontend/app/components.d.ts
~/.cache/Cypress
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Package
id: packaging
run: |
echo "::group::packaging dependencies"
pip3 install --upgrade uv==${{env.UV_VERSION}}
uv pip install --system -r requirements_packaging.txt
echo "::endgroup::"
./package.py --build full
- name: Upload files
uses: actions/upload-artifact@v4
with:
name: linux-app
path: |
dist/*.AppImage
dist/*.AppImage.sha512
build-macos:
name: 'Build macOS binary ${{ matrix.os.arch }}'
if: ${{ github.repository == 'rotki/rotki' || github.event_name != 'schedule' }}
strategy:
fail-fast: false
matrix:
os:
- runner: macos-14
arch: 'arm64'
target: 11
platform: macosx-11.0-arm64
- runner: macos-12
arch: 'x86_64'
target: 10.9
platform: macosx-10.9-x86_64
env:
CI: true
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARCHFLAGS: -arch ${{ matrix.os.arch }}
_PYTHON_HOST_PLATFORM: ${{ matrix.os.platform }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os.target }}
CMAKE_OSX_ARCHITECTURES: ${{ matrix.os.arch }}
NODE_OPTIONS: --max-old-space-size=4096
environment: macos_sign
runs-on: ${{ matrix.os.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Load env
uses: rotki/action-env@v2
with:
env_file: .github/.env.ci
- name: Add rust target for building deps
if: ${{ matrix.os.arch == 'arm64' }}
run: rustup target add aarch64-apple-darwin
- name: Cache python pkg
uses: actions/cache@v4
with:
path: ~/python*.pkg
key: ${{ runner.os }}-python-${{ env.PYTHON_VERSION }}-${{ env.PYTHON_MACOS }}-${{ matrix.os.arch }}
- name: Cache python dependencies
uses: actions/cache@v4
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-${{ matrix.os.arch }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.os.arch }}-pip-
- name: Set up python
run: packaging/setup-macos-python.sh ${{ env.PYTHON_VERSION }} ${{ env.PYTHON_MACOS }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: 'frontend/.nvmrc'
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
package_json_file: frontend/package.json
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
frontend/app/components.d.ts
~/Library/Caches/Cypress
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Package
id: packaging
run: |
echo "::group::packaging dependencies"
pip3 install --upgrade uv==${{env.UV_VERSION}}
pip3 install virtualenv
python3 -m virtualenv ~/venv
source ~/venv/bin/activate
uv pip install -r requirements_packaging.txt
echo "::endgroup::"
./package.py --build full
env:
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }}
CSC_KEY_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
IDENTITY: ${{ secrets.IDENTITY }}
APPLEID: ${{ secrets.APPLEID }}
APPLEIDPASS: ${{ secrets.APPLEIDPASS }}
- name: Upload files (${{ matrix.os.arch }})
uses: actions/upload-artifact@v4
with:
name: macos-app-${{ matrix.os.arch }}
path: |
dist/rotki-darwin_*.dmg
dist/rotki-darwin_*.dmg.sha512
- name: Upload colibri files
uses: actions/upload-artifact@v4
with:
name: macos-colibri-${{ matrix.os.arch }}
path: |
dist/colibri
build-windows:
name: Build windows binary
if: ${{ github.repository == 'rotki/rotki' || github.event_name != 'schedule' }}
env:
CI: true
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_DEPENDENCIES: "build-dependencies"
runs-on: windows-latest
environment: windows_sign
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Load env
uses: rotki/action-env@v2
with:
env_file: .github/.env.ci
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: 'frontend/.nvmrc'
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
package_json_file: frontend/package.json
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
frontend/app/components.d.ts
~\AppData\Local\Cypress
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Build rotki
id: packaging
env:
CERTIFICATE_WIN_APPLICATION: ${{ secrets.CERTIFICATE_WIN_APPLICATION }}
CSC_KEY_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
run: |
echo ::group::"packaging dependencies"
pip3 install --upgrade uv==${{env.UV_VERSION}}
uv pip install --system -r requirements_packaging.txt
echo ::endgroup::
python .\package.py --build full
shell: powershell
- name: Upload files
uses: actions/upload-artifact@v4
with:
name: windows-app
path: |
dist\rotki-win32*.exe
dist\rotki-win32*.exe.sha512
build-docker:
name: Build docker images
if: ${{ github.repository == 'rotki/rotki' || github.event_name != 'schedule' }}
runs-on: ubuntu-latest
environment: docker
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Rotki Version
id: rotki_version
run: |
ROTKI_VERSION=$(cat .bumpversion.cfg | grep 'current_version = ' | sed -n -e 's/current_version = //p')
POSTFIX=$(if git describe --tags --exact-match "$REVISION" &>/dev/null; then echo ''; else echo '-dev'; fi)
ROTKI_VERSION=${ROTKI_VERSION}${POSTFIX}$(date +'%Y%m%d')
echo "version=${ROTKI_VERSION}" >> $GITHUB_OUTPUT
- name: Build Information
id: build_information
run: |
if [[ "$GITHUB_EVENT_NAME" == 'schedule' ]]; then
PLATFORMS='linux/amd64,linux/arm64'
TAG=nightly
else
PLATFORMS=linux/amd64
TAG=dev
fi
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "platforms=$PLATFORMS" >> $GITHUB_OUTPUT
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: ${{ steps.build_information.outputs.platforms }}
push: true
provenance: mode=max
tags: rotki/rotki:${{ steps.build_information.outputs.tag }}
build-args: |
REVISION=${{ github.sha }}
ROTKI_VERSION=${{ steps.rotki_version.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
notify:
name: 'Success check'
if: ${{ always() && (github.repository == 'rotki/rotki' || github.event_name != 'schedule') }}
needs: [ 'build-linux', 'build-windows', 'build-macos', 'build-docker' ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Check if any task failed
run: |
pip install requests
data=($(echo "${{ toJSON(needs.*.result) }}" | sed 's/[][,]//g'))
for i in "${data[@]}"
do
if [[ $i == "failure" ]]; then
./.github/scripts/notifier.py --webhook ${{ secrets.WEBHOOK }} --run-id ${{ github.run_id }}
exit 1;
fi
done