Skip to content

update changelog

update changelog #20

Workflow file for this run

name: Release
on:
workflow_dispatch:
push:
tags:
- '*'
jobs:
build_artifacts:
name: Build Artifacts
runs-on: ubuntu-latest
strategy:
matrix:
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "^1.20"
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Infuse Version
run: bash scripts/version.sh
- name: Build Client (${{ matrix.goos }}-${{ matrix.goarch }})
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: go build -v -o ./bin/goat-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/goat/main.go
- name: Rename Windows Binary
if: ${{ matrix.goos == 'windows' }}
env:
FNAME: ./bin/goat-${{ matrix.goos }}-${{ matrix.goarch }}
run: mv ${{ env.FNAME }} ${{ env.FNAME }}.exe
- name: Upload Artifcats
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ./bin/
retention-days: 1
deploy:
name: Deploy to Releases
runs-on: ubuntu-latest
needs:
- 'build_artifacts'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Retrieve backend binaries
uses: actions/download-artifact@v3
with:
name: artifacts
path: bin/
- name: Inject Version into Changelog
run: |-
sed -i "s/\[VERSION\]/$(git describe --tags --abbrev=0)/g" CHANGELOG.md
- name: Set up Hub
run: |-
sudo snap install hub --classic
- name: Deploy to Releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: "hub release create
$(ls ./bin -1 | xargs -I % printf '-a ./bin/% ')
-F ./CHANGELOG.md
$(git describe --tags --abbrev=0)"