wakapi/.github/workflows/release.yml

56 lines
1.3 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: Release
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: 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
Compress-Archive -Path .\wakapi.exe, .\config.yml -DestinationPath release.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
zip -9 release.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