Skip to content

Commit

Permalink
feat(CI/CD): Add turncat bins to release assets
Browse files Browse the repository at this point in the history
  • Loading branch information
levaitamas committed Jan 18, 2024
1 parent 22c2575 commit de2f0cb
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,56 @@ jobs:
repo: stunner-helm
client_payload: '{"tag": "${{ steps.vars.outputs.tag }}", "type": "stunner"}'
workflow_file_name: publish.yaml

add_turncat_binaries:
name: Add turncat binaries to release assets
needs: run_tests
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: amd64
os: linux
file_end: ""
- arch: arm64
os: linux
file_end: ""
- arch: amd64
os: darwin
file_end: ""
- arch: arm64
os: darwin
file_end: ""
- arch: amd64
os: windows
file_end: ".exe"
- arch: arm64
os: windows
file_end: ".exe"

name: Build release assets
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get version
id: vars
run: echo tag=$(echo ${GITHUB_REF:11}) >> $GITHUB_OUTPUT

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Build turncat binary
run: |
CGO_ENABLED=0 GOARCH=${{ matrix.arch }} GOOS=${{ matrix.os }} go build -ldflags="-w -s" -trimpath -o turncat cmd/turncat/main.go
mv turncat turncat-v${{ steps.vars.outputs.tag }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.file_end }}
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: turncat-v${{ steps.vars.outputs.tag }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.file_end }}
tag: ${{ github.ref_name }}
asset_name: turncat-v${{ steps.vars.outputs.tag }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.file_end }}

0 comments on commit de2f0cb

Please sign in to comment.