chore: add release actions (#177)

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2023-12-27 15:53:18 +08:00 committed by GitHub
parent 8a2b028a71
commit 3ef5889599
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 2 deletions

View File

@ -69,6 +69,6 @@ jobs:
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
VERSION=${{ steps.get_version.outputs.VERSION }}
tags: |
dragonflyoss/dfdaemon-rs:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ env.IMAGE_REPOSITORY }}/dfdaemon-rs:${{ steps.get_version.outputs.VERSION }}
dragonflyoss/client:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ env.IMAGE_REPOSITORY }}/client:${{ steps.get_version.outputs.VERSION }}
push: true

53
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,53 @@
name: Release
on:
push:
tags:
- v*
jobs:
release-github:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: x86_64-unknown-linux-musl
archive: tar.gz
- target: aarch64-unknown-linux-musl
archive: tar.gz
- target: powerpc64le-unknown-linux-gnu
archive: tar.gz
- target: riscv64gc-unknown-linux-gnu
archive: tar.gz
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compile and release
uses: rust-build/rust-build.action@v1.4.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
RUSTTARGET: ${{ matrix.target }}
EXTRA_FILES: "README.md LICENSE"
ARCHIVE_TYPES: ${{ matrix.archive }}
- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
publish-crates:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}