Skip to content

Commit aaa1b10

Browse files
authored
Merge pull request #9 from Crown0815/Crown0815-patch-1
Fix version setting after breaking change
2 parents 0586171 + 7c77228 commit aaa1b10

1 file changed

Lines changed: 27 additions & 10 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,19 @@ on:
2525

2626
jobs:
2727
build:
28-
name: Build ${{matrix.architecture}}
29-
runs-on: ubuntu-latest
28+
name: Build ${{ matrix.architecture }}
29+
runs-on: ${{ matrix.os }}
3030
strategy:
3131
matrix:
32-
architecture: ['386', amd64, arm, arm64]
32+
include:
33+
- architecture: '386'
34+
os: windows-latest
35+
- architecture: amd64
36+
os: windows-latest
37+
- architecture: arm
38+
os: windows-11-arm
39+
- architecture: arm64
40+
os: windows-11-arm
3341
steps:
3442
- uses: actions/checkout@v4
3543
with:
@@ -38,17 +46,26 @@ jobs:
3846
ref: ${{ inputs.tag }}
3947
token: ${{ secrets.CODE_FORGEJO_TOKEN }}
4048

41-
- name: Build for ${{matrix.architecture}}
49+
- name: Build for ${{ matrix.architecture }}
50+
run: |
51+
$env:GOOS = 'windows'
52+
$env:GOARCH = '${{ matrix.architecture }}'
53+
go build `
54+
-ldflags "-s -w -X code.forgejo.org/forgejo/runner/v12/internal/pkg/ver.version=${{ inputs.tag }}" `
55+
-o forgejo-runner-windows-${{ matrix.architecture }}.exe
56+
57+
- name: Check Version Output
4258
run: |
43-
env GOOS=windows GOARCH=${{matrix.architecture}} \
44-
go build \
45-
-ldflags "-s -w -X code.forgejo.org/forgejo/runner/internal/pkg/ver.version=${{ inputs.tag }}" \
46-
-o forgejo-runner-windows-${{matrix.architecture}}.exe
59+
$VERSION_OUTPUT = & .\forgejo-runner-windows-${{ matrix.architecture }}.exe --version
60+
if ($VERSION_OUTPUT -ne 'forgejo-runner version ${{ inputs.tag }}') {
61+
Write-Output "Version mismatch: got $VERSION_OUTPUT expected forgejo-runner version ${{ inputs.tag }}"
62+
exit 1
63+
}
4764
4865
- uses: actions/upload-artifact@v4
4966
with:
50-
name: forgejo-runner-windows-${{matrix.architecture}}
51-
path: forgejo-runner-windows-${{matrix.architecture}}.exe
67+
name: forgejo-runner-windows-${{ matrix.architecture }}
68+
path: forgejo-runner-windows-${{ matrix.architecture }}.exe
5269

5370
test-runner:
5471
name: Run Tests on Windows with Linux Forgejo Server

0 commit comments

Comments
 (0)