Attempt to run build only on releases and generate an actual release with artifacts
All checks were successful
/ cargo test (push) Successful in 21s

This commit is contained in:
Karcsesz 2024-03-18 01:30:19 +01:00
parent 5600c653ef
commit b9c200ab2c
3 changed files with 43 additions and 28 deletions

View file

@ -0,0 +1,34 @@
on: [tag]
jobs:
docker:
name: docker build
runs-on: ubuntu-22.04
steps:
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME}}
password: ${{ secrets.DOCKERHUB_TOKEN}}
- uses: docker/build-push-action@v5
with:
push: false
tags: karcsesz/fingerlink:latest
- uses: docker/build-push-action@v5
with:
push: false
tags: karcsesz/fingerlink:latest-nano
build-args: "editor=nano"
binary:
name: raw artifact
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/rust-toolchain@stable
with:
targets: "x86_64-unknown-linux-musl,aarch64-unknown-linux-musl"
- run: cargo build --release --target x86_64-unknown-linux-musl
- run: cargo build --release --target aarch64-unknown-linux-musl
- run: mkdir _release && mv target/x86_64-unknown-linux-musl/release/fingerlink _release/fingerlink-x86_64 && mv target/aarch64-unknown-linux-musl/release/fingerlink-arm64
- uses: actions/forgejo-release@v1
with:
direction: upload
release-dir: _release

View file

@ -1,28 +0,0 @@
on: [push]
jobs:
test:
name: cargo test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/rust-toolchain@stable
- run: cargo test --all-features
docker:
name: docker build
runs-on: ubuntu-22.04
needs:
- test
steps:
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME}}
password: ${{ secrets.DOCKERHUB_TOKEN}}
- uses: docker/build-push-action@v5
with:
push: false
tags: karcsesz/fingerlink:latest
- uses: docker/build-push-action@v5
with:
push: false
tags: karcsesz/fingerlink:latest-nano
build-args: "editor=nano"

View file

@ -0,0 +1,9 @@
on: [push]
jobs:
test:
name: cargo test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/rust-toolchain@stable
- run: cargo test --all-features