latest signatures #18
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
# This workflow creates a release and builds and uploads | |
# a debian package, as well as linux, windows and mac binaries. | |
# | |
# Trigger this workflow by pushing a version tag e.g. v1.1.0. | |
# Add -rc or -rcN for a release candidate/ prerelease e.g. v1.1.0-rc or v1.1.0-rc1. | |
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
jobs: | |
buildDeb: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ env.VERS }} | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Install latest version of go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.x | |
- name: Make sf and roy binaries | |
run: | | |
go install -tags brew github.com/richardlehane/siegfried/cmd/sf | |
go install -tags brew github.com/richardlehane/siegfried/cmd/roy | |
env: | |
CGO_ENABLED: 0 | |
- name: Set environment variables # trim refs/tags/v using 'cut -c12-' | |
run: | | |
VERSION=$(echo "${{ github.ref }}" | cut -c12-) | |
echo "VERS=$(echo $VERSION | tr . -)" >> $GITHUB_ENV | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
echo "SF_PATH=siegfried_$VERSION-1_amd64" >> $GITHUB_ENV | |
echo "BIN_PATH=$(go env GOPATH)/bin" >> $GITHUB_ENV | |
- name: Execute debbuilder script | |
run: (chmod +x debbuilder.sh && ./debbuilder.sh) | |
- name: Zip executables | |
run: zip -j siegfried_${{ env.VERS }}_linux64.zip ${{ env.BIN_PATH }}/sf ${{ env.BIN_PATH }}/roy | |
- name: Make self-contained sf binary | |
run: go install -tags "brew static" github.com/richardlehane/siegfried/cmd/sf | |
env: | |
CGO_ENABLED: 0 | |
- name: Zip self-contained executable | |
run: zip -j siegfried_${{ env.VERS }}_linux64_static.zip ${{ env.BIN_PATH }}/sf | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: release-artifacts | |
path: | | |
${{ env.SF_PATH }}.deb | |
siegfried_${{ env.VERS }}_linux64.zip | |
siegfried_${{ env.VERS }}_linux64_static.zip | |
buildMac: | |
runs-on: macos-latest | |
needs: buildDeb | |
env: | |
VERSION: ${{needs.buildDeb.outputs.version}} | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Install latest version of go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.x | |
- name: Make sf and roy binaries | |
run: | | |
go install -tags brew github.com/richardlehane/siegfried/cmd/sf | |
go install -tags brew github.com/richardlehane/siegfried/cmd/roy | |
- name: Zip executables | |
run: zip -j siegfried_${{ env.VERSION }}_mac64.zip $(go env GOPATH)/bin/sf $(go env GOPATH)/bin/roy | |
- name: Make self-contained sf binary | |
run: go install -tags "brew static" github.com/richardlehane/siegfried/cmd/sf | |
- name: Zip self-contained executable | |
run: zip -j siegfried_${{ env.VERSION }}_mac64_static.zip $(go env GOPATH)/bin/sf | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: release-artifacts | |
path: | | |
siegfried_${{ env.VERSION }}_mac64.zip | |
siegfried_${{ env.VERSION }}_mac64_static.zip | |
buildWin: | |
runs-on: windows-latest | |
needs: buildDeb | |
env: | |
VERSION: ${{needs.buildDeb.outputs.version}} | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Install latest version of go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.x | |
- name: Make sf and roy binaries | |
run: | | |
go install github.com/richardlehane/siegfried/cmd/sf | |
go install github.com/richardlehane/siegfried/cmd/roy | |
- name: Zip assets | |
shell: pwsh | |
run: | | |
7z a siegfried_${{ env.VERSION }}_win64.zip ((go env GOPATH) + "\bin\*.exe") | |
md siegfried | |
Copy-Item cmd\roy\data\* siegfried -recurse | |
7z a data_${{ env.VERSION }}.zip siegfried | |
- name: Make self-contained sf binary | |
run: go install -tags static github.com/richardlehane/siegfried/cmd/sf | |
- name: Zip static binary | |
shell: pwsh | |
run: 7z a siegfried_${{ env.VERSION }}_win64_static.zip ((go env GOPATH) + "\bin\sf.exe") | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: release-artifacts | |
path: | | |
siegfried_${{ env.VERSION }}_win64.zip | |
siegfried_${{ env.VERSION }}_win64_static.zip | |
data_${{ env.VERSION }}.zip | |
createRelease: | |
runs-on: ubuntu-latest | |
needs: [buildMac, buildWin] | |
steps: | |
- name: Set version | |
run: echo "VERSION=$(echo "${{ github.ref }}" | cut -c12-)" >> $GITHUB_ENV | |
- uses: actions/download-artifact@v3 | |
with: | |
name: release-artifacts | |
path: release-artifacts | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Version ${{ env.VERSION }} | |
prerelease: ${{ contains(github.ref, 'rc') }} | |
body: see CHANGELOG.md | |
files: release-artifacts/* |