Skip to content

Commit 25f4dd3

Browse files
michaeladlerstormc
authored andcommitted
ci: fix release pipeline
We cannot run the `docker` command inside a container, so we must use the host OS for Docker-related tasks. To ensure reproducible builds, we extract the desired Go version string from the go.mod file. Signed-off-by: Michael Adler <[email protected]>
1 parent 3b14705 commit 25f4dd3

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,26 @@ permissions:
1717
jobs:
1818
wfx:
1919
runs-on: ubuntu-latest
20-
container: golang:1.22.5@sha256:fcae9e0e7313c6467a7c6632ebb5e5fab99bd39bd5eb6ee34a211353e647827a
2120
steps:
2221
- name: Checkout
2322
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
2423
with:
2524
fetch-depth: 0
2625
- name: Disable git security features
2726
run: git config --global safe.directory '*'
28-
- run: .ci/setup-build.sh
27+
- name: Export Golang version as env variable
28+
run: |
29+
GO_VERSION=$(grep -E '^go\s*[0-9]+\.[0-9]+\.[0-9]+$' go.mod | sed 's/^go\s*//')
30+
# You can make an environment variable available to any subsequent
31+
# steps in a workflow job by defining or updating the environment
32+
# variable and writing this to the GITHUB_ENV environment file.
33+
echo "GO_VERSION=$GO_VERSION" | tee -a "$GITHUB_ENV"
34+
- uses: actions/setup-go@v5
35+
with:
36+
go-version: "${{ env.GO_VERSION }}"
37+
- run: sudo .ci/setup-build.sh
2938
# goreleaser requires an absolute path to the compiler
30-
- run: install -m0755 .ci/zcc /usr/local/bin/zcc
39+
- run: sudo install -m0755 .ci/zcc /usr/local/bin/zcc
3140
- name: Login to GitHub Container Registry
3241
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3
3342
with:

0 commit comments

Comments
 (0)