Skip to content

Commit 14936c5

Browse files
committed
fix: github workflows set CGO_ENABLED=0 on for build job
1 parent 1235bd7 commit 14936c5

File tree

3 files changed

+31
-22
lines changed

3 files changed

+31
-22
lines changed

.github/workflows/main.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
1110
build:
12-
1311
name: Build && tests for ${{ matrix.name }}
1412
runs-on: ${{ matrix.os }}
13+
env:
14+
CGO_ENABLED: '0'
1515
strategy:
1616
matrix:
1717
include:
@@ -20,29 +20,32 @@ jobs:
2020
osEnv: GOOS=linux GOARCH=amd64
2121
runLint: true
2222
runTests: true
23+
2324
- name: linux 386
2425
os: ubuntu-latest
2526
osEnv: GOOS=linux GOARCH=386
2627
runLint: true
2728
runTests: true
29+
2830
- name: darwin amd64
2931
os: macos-latest
3032
osEnv: GOOS=darwin GOARCH=amd64
3133
runLint: true
3234
runTests: true
35+
3336
- name: darwin arm64
3437
os: macos-latest
3538
osEnv: GOOS=darwin GOARCH=arm64
3639
runLint: false
3740
runTests: false
41+
3842
- name: windows amd64
3943
os: ubuntu-latest
4044
osEnv: GOOS=windows GOARCH=amd64
4145
runLint: false
4246
runTests: false
4347

4448
steps:
45-
4649
- name: Check out code into the Go module directory
4750
uses: actions/checkout@v4
4851

@@ -51,8 +54,6 @@ jobs:
5154
with:
5255
go-version-file: "go.mod"
5356
id: go
54-
env:
55-
CGO_ENABLED: 0
5657

5758
- name: Get dependencies
5859
run: |

.github/workflows/tag.yml

+24-16
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
name: Upload build asset
1+
name: Tag
22

33
on:
44
release:
55
types: [published]
66

77
jobs:
88
build:
9-
name: Upload build asset for ${{ matrix.name }}
9+
name: Build & upload ${{ matrix.name }}
1010
runs-on: ${{ matrix.os }}
11+
env:
12+
CGO_ENABLED: '0'
1113
strategy:
1214
matrix:
1315
include:
@@ -19,6 +21,7 @@ jobs:
1921
strip: true
2022
runLint: true
2123
runTests: true
24+
2225
- name: linux 386
2326
os: ubuntu-latest
2427
buildCmd: env GOOS=linux GOARCH=386 go build -o builds/zcli-linux-i386 -ldflags "-s -w -X github.com/zeropsio/zcli/src/cmd.version=${{ github.event.release.tag_name }}" ./cmd/zcli/main.go
@@ -27,6 +30,7 @@ jobs:
2730
strip: true
2831
runLint: true
2932
runTests: true
33+
3034
- name: darwin amd64
3135
os: macos-latest
3236
buildCmd: env GOOS=darwin GOARCH=amd64 go build -o builds/zcli-darwin-amd64 -ldflags "-s -w -X github.com/zeropsio/zcli/src/cmd.version=${{ github.event.release.tag_name }}" ./cmd/zcli/main.go
@@ -35,6 +39,7 @@ jobs:
3539
strip: false
3640
runLint: true
3741
runTests: true
42+
3843
- name: darwin arm64
3944
os: macos-latest
4045
buildCmd: env GOOS=darwin GOARCH=arm64 go build -o builds/zcli-darwin-arm64 -ldflags "-s -w -X github.com/zeropsio/zcli/src/cmd.version=${{ github.event.release.tag_name }}" ./cmd/zcli/main.go
@@ -43,6 +48,7 @@ jobs:
4348
strip: false
4449
runLint: false
4550
runTests: false
51+
4652
- name: windows amd64
4753
os: ubuntu-latest
4854
buildCmd: env GOOS=windows GOARCH=amd64 go build -o builds/zcli-win-x64.exe -ldflags "-s -w -X github.com/zeropsio/zcli/src/cmd.version=${{ github.event.release.tag_name }}" ./cmd/zcli/main.go
@@ -53,7 +59,6 @@ jobs:
5359
runTests: false
5460

5561
steps:
56-
5762
- name: Checkout code
5863
uses: actions/checkout@v4
5964

@@ -62,8 +67,6 @@ jobs:
6267
with:
6368
go-version-file: "go.mod"
6469
id: go
65-
env:
66-
CGO_ENABLED: 0
6770

6871
- name: Get dependencies
6972
run: |
@@ -103,17 +106,6 @@ jobs:
103106
asset_name: ${{ matrix.file }}
104107
asset_content_type: application/octet-stream
105108

106-
- name: Notify discord about new release
107-
uses: sarisia/[email protected]
108-
with:
109-
webhook: ${{ secrets.DISCORD_WEBHOOK }}
110-
title: "New version of `zcli` is ready!"
111-
description: |
112-
Version `${{ github.event.release.tag_name }}`
113-
Changelog [here](${{ github.event.release.html_url }})
114-
color: 0xff91a4
115-
username: GitHub
116-
117109
publish-npm:
118110
needs: build
119111
runs-on: ubuntu-latest
@@ -131,3 +123,19 @@ jobs:
131123
npm publish --access=public
132124
env:
133125
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
126+
127+
report:
128+
needs: build
129+
runs-on: ubuntu-latest
130+
steps:
131+
- name: Notify discord about new release
132+
uses: sarisia/[email protected]
133+
with:
134+
webhook: ${{ secrets.DISCORD_WEBHOOK }}
135+
title: "New version of `zcli` is ready!"
136+
nocontext: 'true'
137+
description: |
138+
Version `${{ github.event.release.tag_name }}`
139+
Changelog [here](${{ github.event.release.html_url }})
140+
color: 0xff91a4
141+
username: GitHub

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [v1.0.25] - 2024-09-10
7+
## [v1.0.26] - 2024-09-10
88

99
### Changed
1010
- Build binaries with CGO_ENABLED=0

0 commit comments

Comments
 (0)