From a168fb5600625a858faa0d2f3b75ddb5491f4da8 Mon Sep 17 00:00:00 2001 From: Tony Date: Mon, 15 Jan 2024 14:41:07 +0800 Subject: [PATCH] Add release build github action --- .github/workflows/build-release.yaml | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/build-release.yaml diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml new file mode 100644 index 0000000..72ba473 --- /dev/null +++ b/.github/workflows/build-release.yaml @@ -0,0 +1,50 @@ +name: Build Release + +on: + push: + tags: + - 'v*.*.*' + workflow_dispatch: + +permissions: + contents: write + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + strategy: + matrix: + os: [windows-latest, ubuntu-latest] + include: + - os: windows-latest + os-name: windows + executable-extension: .exe + - os: ubuntu-latest + os-name: linux + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + + - name: Build + run: cargo build --release + + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os-name }}-client + path: ./target/release/client${{ matrix.executable-extension }} + + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os-name }}-server + path: ./target/release/server${{ matrix.executable-extension }} + + release: + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/download-artifact@v4 + - uses: softprops/action-gh-release@v1