cheapsdo2.0/.forgejo/workflows/release.yml

34 lines
1.4 KiB
YAML

on:
push:
tags: 'v*'
jobs:
publish-release:
runs-on: docker
container:
image: forgejo.zenerdio.de/sebastian/cheapsdo-ci:v0.1.0
steps:
- uses: actions/checkout@v3
- uses: actions/cache/restore@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: build-cheapsdo
- run: cd hostsoftware && CARGO_HOME=~/.cargo cargo build --target x86_64-pc-windows-gnu --release
- run: cd hostsoftware && CARGO_HOME=~/.cargo PATH=$PATH:$CARGO_HOME/bin x build -r --format appimage
- run: cd firmware && CARGO_HOME=~/.cargo cargo build --target thumbv7m-none-eabi --release
- run: mkdir -p release
- run: cp target/x/release/linux/x64/cheapsdo-control.AppImage release/cheapsdo-control-${{ github.ref_name }}.AppImage
- run: cp target/x86_64-pc-windows-gnu/release/cheapsdo-control.exe release/cheapsdo-control-${{ github.ref_name }}.exe
- run: cp target/thumbv7m-none-eabi/release/cheapsdo release/cheapsdo-firmware
- run: cd release && zip cheapsdo-win.zip cheapsdo-control.exe && rm cheapsdo-control.exe
- uses: actions/forgejo-release@v1
with:
direction: upload
release-dir: release
token: ${{ secrets.FORGEJO_RELEASE }}