wakapi/.github/workflows/release.yml

55 lines
1.2 KiB
YAML
Raw Normal View History

2022-05-19 08:06:11 +03:00
name: Release
2020-05-31 11:29:15 +03:00
on:
2022-09-06 13:41:04 +03:00
release:
types:
- published
2020-05-31 11:29:15 +03:00
jobs:
release:
name: 'Build, package and release to GitHub'
2022-09-06 13:16:22 +03:00
runs-on: ubuntu-latest
2022-05-19 08:06:11 +03:00
strategy:
2022-09-06 13:41:04 +03:00
fail-fast: false
2022-05-19 08:06:11 +03:00
matrix:
2022-09-06 13:16:22 +03:00
GOOS: [darwin, windows, linux]
GOARCH: [amd64, arm64]
2020-05-31 11:29:15 +03:00
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
2022-03-20 18:39:38 +03:00
go-version: ^1.18
2020-05-31 11:29:15 +03:00
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
2022-09-06 13:16:22 +03:00
- name: Prepare
run: |
mkdir -p dist/ && cd dist/
cp ../config.default.yml config.yml
2022-05-19 08:09:50 +03:00
2020-05-31 11:29:15 +03:00
- name: Build
2022-09-06 13:16:22 +03:00
working-directory: ./dist
run: |
2022-09-06 13:16:22 +03:00
GOOS=${{ matrix.GOOS }} GOARCH=${{ matrix.GOARCH }} go build -v ../
- name: Compress working folder
working-directory: ./dist
2022-05-19 08:06:11 +03:00
run: |
2022-09-06 13:16:22 +03:00
zip -9 wakapi_${{ matrix.GOOS }}_${{ matrix.GOARCH }}.zip *
2020-05-31 11:29:15 +03:00
2022-09-06 13:41:04 +03:00
- name: Upload built executable to Release
uses: softprops/action-gh-release@v1
with:
files: ./dist/*.zip