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