Fix flags parameter. #21
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- mbuild-pr | |
tags: | |
- "v*.*.*" | |
permissions: | |
contents: write | |
jobs: | |
cgo-build: | |
strategy: | |
matrix: | |
targets: | |
- 'linux-amd64' | |
- 'linux-amd64-musl' | |
- 'linux-arm64' | |
- 'linux-arm64-musl' | |
name: Build Binaries | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
- name: Build go program | |
id: cgo-action | |
uses: go-cross/cgo-actions@v1 | |
with: | |
flags: -ldflags=-X 'github.com/Keeper-Security/linux-keyring-utility/cmd.Version=$(git describe --tags --always)' | |
packages: main.go | |
static-link-for-musl: false | |
targets: ${{ matrix.targets }} | |
output: lkru-${{ github.ref_name }}_$target$ext | |
- run: echo "${{ steps.cgo-action.outputs.files }}" | |
- name: Upload Release Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: binaries | |
path: | | |
bin/*-${{ github.ref_name }}_* | |
release: | |
name: Create Release | |
needs: cgo-build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: binaries | |
- name: Create checksums | |
run: | | |
shasum -a 256 *-${{ github.ref_name }}_* >| checksums.txt | |
file *-${{ github.ref_name }}_* checksums.txt | |
- name: Sign checksums | |
run: | | |
GPG_TTY=$(tty) gpg -vvv --batch --yes --detach-sign --armor \ | |
--output checksums.txt.sig \ | |
--passphrase "${{ secrets.GPG_PASSPHRASE }}" \ | |
--pinentry-mode loopback checksums.txt | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release create "${{ github.ref_name }}" \ | |
--title "${{ github.ref_name }}" \ | |
--repo "${{ github.repository }}" \ | |
--generate-notes | |
- name: Upload artifacts | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload "${{ github.ref_name }}" \ | |
--repo "${{ github.repository }}" \ | |
*-${{ github.ref_name }}_* \ | |
checksums.txt checksums.txt.sig | |