From 6be93045233851a2c5b7ae515d1ef8cf16c87119 Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Sun, 3 Mar 2024 22:12:10 +0800 Subject: [PATCH] Update CI --- .github/workflows/release-rpm.yaml | 51 ++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/release-rpm.yaml diff --git a/.github/workflows/release-rpm.yaml b/.github/workflows/release-rpm.yaml new file mode 100644 index 0000000..8f39068 --- /dev/null +++ b/.github/workflows/release-rpm.yaml @@ -0,0 +1,51 @@ +name: Release RPM +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag to release' + required: true + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Check tag exists + uses: mukunku/tag-exists-action@v1.6.0 + id: check-tag + with: + tag: ${{ github.event.inputs.tag }} + - name: Exit if tag does not exist + run: | + if [[ "${{ steps.check-tag.outputs.exists }}" == "false" ]]; then + echo "Tag ${{ github.event.inputs.tag }} does not exist" + exit 1 + fi + + # Include arm64 if ref is a tag + setup-matrix: + needs: + - check + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Set up matrix + id: set-matrix + run: | + if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then + echo "matrix=[\"ubuntu-latest\", \"arm64\"]" >> $GITHUB_OUTPUT + else + echo "matrix=[\"ubuntu-latest\"]" >> $GITHUB_OUTPUT + fi + + build: + needs: + - setup-matrix + strategy: + matrix: + os: ${{fromJson(needs.setup-matrix.outputs.matrix)}} + runs-on: ${{ matrix.os }} + steps: + - name: Dowload ${{ github.event.inputs.tag }} source code + uses: robinraju/release-downloader@v1.9