-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (44 loc) · 1.39 KB
/
release.yml
File metadata and controls
44 lines (44 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
on:
push:
tags:
- "v*.*.*"
name: Release
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
goos: [ linux, windows, darwin ]
goarch: [ 386, arm64, amd64 ]
exclude:
- goarch: "386"
goos: darwin
steps:
- name: Checkout the latest code
uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Build ${{ matrix.goos }}/${{ matrix.goarch }}
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
shell: bash
run: |
VERSION="$(git describe --tags | cut -d '-' -f1 | cut -d 'v' -f2)"
LDFLAGS="-X github.com/jamf/helm-github/main.Version=${VERSION}"
if [ "$GOOS" = "windows" ]; then
go build -ldflags "${LDFLAGS}" -v -o dist/bin/helmgithub.exe
else
CGO_ENABLED=0 go build -ldflags "${LDFLAGS}" -v -o dist/bin/helmgithub
fi
cp plugin.yaml dist/
tar -czvf helm-github_${VERSION}_${{ matrix.goos }}_${{ matrix.goarch }}.tar.gz -C dist/ .
sha256sum "helm-github_${VERSION}_${{ matrix.goos }}_${{ matrix.goarch }}.tar.gz" | awk '{ print $1 }' > helm-github_${VERSION}_${{ matrix.goos }}_${{ matrix.goarch }}_checksum.txt
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
*.tar.gz
*.txt