1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00
wakapi/.github/workflows/release.yml

78 lines
1.8 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:
push:
branches:
pull_request:
2020-05-31 11:29:15 +03:00
release:
types:
- published
2020-05-31 11:29:15 +03:00
jobs:
build-and-release:
2022-05-19 08:06:11 +03:00
name: Build & Release
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
2020-05-31 11:29:15 +03:00
- name: Enable Go 1.11 modules
2022-05-19 08:09:50 +03:00
if: runner.os == 'Windows'
2020-05-31 11:29:15 +03:00
run: cmd /c "set GO111MODULE=on"
2022-05-19 08:09:50 +03:00
- name: Unit Tests
run: go test ./... -run ./...
- name: API Tests
run: |
npm -g install newman
./testing/run_api_tests.sh
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
if: github.event_name == 'release'
2020-05-31 11:29:15 +03:00
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: release.zip
2022-05-19 08:50:43 +03:00
asset_name: wakapi_${{ matrix.alias }}_amd64.zip
2020-05-31 11:29:15 +03:00
asset_content_type: application/gzip