From 292ce21ea543ca64d14d0d63892e2279ecc6c5b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Kro=CC=88ner?= Date: Tue, 5 Nov 2024 15:05:43 +0100 Subject: [PATCH] ci: Use go environment variables to control compilation --- .github/workflows/build-release.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index cd84586..09d05e3 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -6,38 +6,40 @@ on: tags: 'v*' jobs: build: - runs-on: windows-latest + name: Build ${{matrix.architecture}} + runs-on: ubuntu-latest + strategy: + matrix: + architecture: ['386', amd64, arm, arm64] steps: - uses: actions/checkout@v4 - - - name: Build + - name: Build for ${{matrix.architecture}} run: | - go build -o forgejo-runner.exe + env GOOS=windows GOARCH=${{matrix.architecture}} \ + go build -o forgejo-runner-windows-${{matrix.architecture}}.exe - - name: Upload release - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v4 with: - name: forgejo-runner - path: forgejo-runner.exe + name: forgejo-runner-windows-${{matrix.architecture}} + path: forgejo-runner-windows-${{matrix.architecture}}.exe release: runs-on: ubuntu-latest needs: build if: github.event_name == 'push' && github.ref_type == 'tag' steps: - - name: Download artifact - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4 with: - name: forgejo-runner path: . - name: Create Release uses: softprops/action-gh-release@v2 with: tag_name: ${{ github.ref_name }} - files: forgejo-runner.exe + files: forgejo-runner-windows-*/forgejo-runner-windows-*.exe draft: false prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }} token: ${{ secrets.RELEASE_TOKEN }} + fail_on_unmatched_files: true body: See [original release notes](https://code.forgejo.org/forgejo/runner/releases/tag/${{ github.ref_name }}).