diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cf5a5c9..746e160 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,3 +1,4 @@ +--- name: Build RPM on: @@ -13,46 +14,46 @@ jobs: build: runs-on: ubuntu-latest - + strategy: matrix: arch: [amd64, arm64] steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: 1.21.8 - - - name: Install Build Dependencies - run: | - sudo apt update - sudo apt install -y rpm make - - - name: Build RPM - ${{ matrix.arch }} - run: | - # Get the release name - release_name=$(echo "${GITHUB_REF}" | awk -F'/' '{print $NF}') - - # Extract the version from the release name - version=$(echo "${release_name}" | grep -oE "[0-9]+\.[0-9]+\.[0-9]+") + - name: Checkout Repository + uses: actions/checkout@v4 - make build ARCH=${{ matrix.arch }} VERSION=${version} - make rpm ARCH=${{ matrix.arch }} VERSION=${version} + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.21.8 - - name: Upload RPMs to Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - files: | - rpmbuild/RPMS/**/*.rpm - out/* - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Job fail - continue-on-error: true - run: | - make clean + - name: Install Build Dependencies + run: | + sudo apt update + sudo apt install -y rpm make + + - name: Build RPM - ${{ matrix.arch }} + run: | + # Get the release name + release_name=$(echo "${GITHUB_REF}" | awk -F'/' '{print $NF}') + + # Extract the version from the release name + version=$(echo "${release_name}" | grep -oE "[0-9]+\.[0-9]+\.[0-9]+") + + make build ARCH=${{ matrix.arch }} VERSION=${version} + make rpm ARCH=${{ matrix.arch }} VERSION=${version} + + - name: Upload RPMs to Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + rpmbuild/RPMS/**/*.rpm + out/* + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Job fail + continue-on-error: true + run: | + make clean