wakapi/.github/workflows/release.yml

64 lines
1.6 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:
release:
types:
- published
2020-05-31 11:29:15 +03:00
jobs:
release:
name: 'Build, package and release to GitHub'
2022-05-19 08:06:11 +03:00
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
2022-05-19 09:12:00 +03:00
include:
- platform: ubuntu-latest
alias: linux
- platform: macos-latest
alias: mac
- platform: windows-latest
alias: win
2022-05-19 08:06:11 +03:00
runs-on: ${{ matrix.platform }}
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
2020-05-31 11:29:15 +03:00
- name: Get dependencies
run: go get
2022-05-19 08:09:50 +03:00
2020-05-31 11:29:15 +03:00
- name: Build
run: go build -v .
2022-05-19 08:06:11 +03:00
- name: Compress working folder on Windows
if: runner.os == 'Windows'
run: |
cp .\config.default.yml .\config.yml
2022-05-20 07:01:34 +03:00
Compress-Archive -Path .\wakapi.exe, .\config.yml -DestinationPath wakapi_${{ matrix.alias }}_amd64.zip
2022-05-19 08:06:11 +03:00
- name: Compress working folder on Unix
2022-05-19 08:10:23 +03:00
if: runner.os != 'Windows'
2022-05-19 08:06:11 +03:00
run: |
cp config.default.yml config.yml
2022-05-20 07:01:34 +03:00
zip -9 wakapi_${{ matrix.alias }}_amd64.zip wakapi config.yml
2020-05-31 11:29:15 +03:00
- name: Upload built executable to Release
uses: softprops/action-gh-release@v1
2020-05-31 11:29:15 +03:00
with:
files: wakapi_${{ matrix.alias }}_amd64.zip