Merge pull request #25 from SerRichard/SerRichard-patch-8 #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
name: Build and Release | |
permissions: | |
contents: write | |
on: | |
push: | |
tags: | |
- '*.*.*' | |
jobs: | |
build: | |
name: Build Binaries | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goos: [linux, darwin, windows] | |
goarch: [amd64] | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.23' | |
- name: Get the Tag | |
id: get_tag | |
run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: Build Binary | |
run: | | |
mkdir -p dist/ | |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o dist/proteus-${{ matrix.goos }}-${{ matrix.goarch }}-${{ env.TAG_NAME }} ./cli | |
- name: Compress Binary | |
if: matrix.goos != 'windows' | |
run: gzip dist/proteus-${{ matrix.goos }}-${{ matrix.goarch }}-${{ env.TAG_NAME }} | |
- name: Install GitHub CLI | |
run: sudo apt-get install gh -y | |
- name: Upload Release Asset (Linux and macOS) | |
if: matrix.goos != 'windows' | |
run: | | |
gh release upload ${{ github.ref_name }} dist/proteus-${{ matrix.goos }}-${{ matrix.goarch }}-${{ github.ref_name }}.gz --clobber | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Release Asset (Windows) | |
if: matrix.goos == 'windows' | |
run: | | |
gh release upload ${{ github.ref_name }} dist/proteus-${{ matrix.goos }}-${{ matrix.goarch }}-${{ github.ref_name }} --clobber | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |