Skip to content

Commit

Permalink
Build fixes. (#17)
Browse files Browse the repository at this point in the history
- Set the version via the environment
- Update upload and download-artifacts to v4
  • Loading branch information
amigus authored Sep 13, 2024
1 parent 485f36f commit 2b81e22
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,24 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5

- name: Build go program
- name: Declare version
run: |
echo BUILD_VERSION="$(git describe --tags --always)" >> $GITHUB_ENV
- name: BUILD_VERSION go program
id: cgo-action
uses: go-cross/cgo-actions@v1
env:
BUILD_VERSION: ${{ env.BUILD_VERSION }}
with:
flags: -ldflags=-w -s -X 'github.com/Keeper-Security/linux-keyring-utility/cmd.Version=$(git describe --tags --always)'
flags: -ldflags=-X 'github.com/Keeper-Security/linux-keyring-utility/cmd.Version=${{ env.BUILD_VERSION }}'
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
uses: actions/upload-artifact@v4
with:
name: binaries
name: binaries-${{ matrix.targets }}
path: |
bin/*-${{ github.ref_name }}_*
Expand All @@ -58,15 +62,20 @@ jobs:
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: binaries

- name: Create checksums
path: bin
pattern: binaries-*
merge-multiple: true

- name: Strip binaries with symbols
run: |
shasum -a 256 *-${{ github.ref_name }}_* >| checksums.txt
file *-${{ github.ref_name }}_* checksums.txt
strip -s bin/*_linux-amd64
- name: Create checksums
run: |
cd bin; shasum -a 256 *-${{ github.ref_name }}_* >| ../checksums.txt
- name: Sign checksums
run: |
GPG_TTY=$(tty) gpg -vvv --batch --yes --detach-sign --armor \
Expand All @@ -89,7 +98,7 @@ jobs:
run: |
gh release upload "${{ github.ref_name }}" \
--repo "${{ github.repository }}" \
*-${{ github.ref_name }}_* \
bin/*-${{ github.ref_name }}_* \
checksums.txt checksums.txt.sig
Expand Down

0 comments on commit 2b81e22

Please sign in to comment.