Skip to content

Merge pull request #21 from SerRichard/SerRichard-patch-4 #15

Merge pull request #21 from SerRichard/SerRichard-patch-4

Merge pull request #21 from SerRichard/SerRichard-patch-4 #15

Workflow file for this run

name: Build and Release
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: Upload Release Asset
uses: actions/upload-artifact@v3
with:
name: proteus-${{ matrix.goos }}-${{ matrix.goarch }}-${{ env.TAG_NAME }}
path: dist/proteus-${{ matrix.goos }}-${{ matrix.goarch }}-${{ env.TAG_NAME }}*
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: dist/
- name: Print current directory
run: pwd
- name: List files in dist with absolute path
run: ls ${{ github.workspace }}
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: ${{ github.workspace }}/dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}