wakapi/.github/workflows/release.yml

55 lines
1.2 KiB
YAML

name: Release
on:
release:
types:
- published
jobs:
release:
name: 'Build, package and release to GitHub'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
GOOS: [darwin, windows, linux]
GOARCH: [amd64, arm64]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Set version
shell: bash
run: |
(git describe --tags --exact-match \
|| git symbolic-ref -q --short HEAD \
|| git rev-parse --short HEAD) > version.txt 2> /dev/null
- name: Prepare
run: |
mkdir -p dist/ && cd dist/
cp ../config.default.yml config.yml
- name: Build
working-directory: ./dist
run: |
GOOS=${{ matrix.GOOS }} GOARCH=${{ matrix.GOARCH }} go build -v ../
- name: Compress working folder
working-directory: ./dist
run: |
zip -9 wakapi_${{ matrix.GOOS }}_${{ matrix.GOARCH }}.zip *
- name: Upload built executable to Release
uses: softprops/action-gh-release@v1
with:
files: ./dist/*.zip