Merge pull request 'Added forgejo-actions' (#1) from forgejo-actions into main
/ audit (push) Successful in 21s Details
/ build-linux (push) Successful in 3m27s Details
/ build-windows (push) Successful in 1m40s Details
/ build-firmware (push) Successful in 26s Details
/ build-appimage (push) Has been cancelled Details

Reviewed-on: #1
This commit is contained in:
Sebastian 2024-01-14 18:22:24 +01:00
commit 08f9ae557d
3 changed files with 123 additions and 0 deletions

View File

@ -0,0 +1,18 @@
on: push
jobs:
audit:
runs-on: docker
container:
image: forgejo.zenerdio.de/sebastian/cheapsdo-ci:v0.1.0
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: audit-cheapsdo
- run: CARGO_HOME=/root/.cargo cargo audit

View File

@ -0,0 +1,72 @@
on: push
jobs:
build-firmware:
runs-on: docker
container:
image: forgejo.zenerdio.de/sebastian/cheapsdo-ci:v0.1.0
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: build-cheapsdo
restore-keys: audit-cheapsdo
- run: cd firmware && CARGO_HOME=~/.cargo cargo build --target thumbv7m-none-eabi --release
build-linux:
runs-on: docker
container:
image: forgejo.zenerdio.de/sebastian/cheapsdo-ci:v0.1.0
steps:
- uses: actions/checkout@v3
- uses: actions/cache@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 --release
build-windows:
runs-on: docker
container:
image: forgejo.zenerdio.de/sebastian/cheapsdo-ci:v0.1.0
needs: build
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
build-appimage:
runs-on: docker
container:
image: forgejo.zenerdio.de/sebastian/cheapsdo-ci:v0.1.0
needs: build
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 PATH=$PATH:$CARGO_HOME/bin x build -r --format appimage

View File

@ -0,0 +1,33 @@
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 }}