Skip to content

Commit

Permalink
ci: Use go environment variables to control compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Crown0815 committed Nov 5, 2024
1 parent f44738d commit 48752b5
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,35 @@ on:
tags: 'v*'
jobs:
build:
runs-on: windows-latest
name: Build ${{matrix.os}}
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
with:
name: forgejo-runner
path: .
- uses: actions/download-artifact@v4

- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: forgejo-runner.exe
files: forgejo-runner-windows-*.exe
draft: false
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}
token: ${{ secrets.RELEASE_TOKEN }}
Expand Down

0 comments on commit 48752b5

Please sign in to comment.