Skip to content

Merge pull request #27 from wandera/dependabot/go_modules/google.gola… #9

Merge pull request #27 from wandera/dependabot/go_modules/google.gola…

Merge pull request #27 from wandera/dependabot/go_modules/google.gola… #9

Workflow file for this run

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@v4
- name: Install Go
uses: actions/setup-go@v5
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/wandera/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@v1
with:
files: |
*.tar.gz
*.txt