ci: Use go environment variables to control compilation #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build release | |
on: | |
push: | |
tags: 'v*' | |
jobs: | |
build: | |
name: Build ${{matrix.architecture}} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
architecture: ['386', amd64, arm, arm64] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build for ${{matrix.architecture}} | |
run: | | |
env GOOS=windows GOARCH=${{matrix.architecture}} \ | |
go build -o forgejo-runner-windows-${{matrix.architecture}}.exe | |
- uses: actions/upload-artifact@v4 | |
with: | |
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: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: . | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ github.ref_name }} | |
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 }}). | |