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

Merge pull request #97 from muety/actions

fix(ci): actions release, build on push/pr
This commit is contained in:
Ferdinand Mütsch 2021-01-24 12:23:05 +01:00 committed by GitHub
commit b2a3579be9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 15 deletions

View File

@ -1,13 +1,15 @@
name: Build Wakapi on Linux
on:
push:
pull_request:
release:
types:
- created
jobs:
build-and-release:
name: Build and add to Release
name: Build
runs-on: ubuntu-latest
steps:
@ -22,18 +24,21 @@ jobs:
- name: Get dependencies
run: |
go get -v -t -d ./...
go get github.com/markbates/pkger/cmd/pkger
go get
go generate
- name: Build
run: GO111MODULE=on go build -v .
- name: Zip Release
uses: TheDoctor0/zip-release@v0.3.0
with:
filename: release.zip
exclusions: '*.git*'
- name: Zip executable and sample config
if: github.event_name == 'release'
run: |
cp config.default.yml config.yml
zip -9 release.zip wakapi config.yml
- name: Upload built executable to Release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,13 +1,15 @@
name: Build Wakapi on Windows
on:
push:
pull_request:
release:
types:
- created
jobs:
build-and-release:
name: Build and add to release
name: Build
runs-on: windows-latest
steps:
@ -22,7 +24,9 @@ jobs:
- name: Get dependencies
run: |
go get -v -t -d ./...
go get github.com/markbates/pkger/cmd/pkger
go get
go generate
- name: Enable Go 1.11 modules
run: cmd /c "set GO111MODULE=on"
@ -31,9 +35,13 @@ jobs:
run: go build -v .
- name: Compress working folder
run: Compress-Archive -Path .\* -DestinationPath release.zip
if: github.event_name == 'release'
run: |
cp .\config.default.yml .\config.yml
Compress-Archive -Path .\wakapi.exe, .\config.yml -DestinationPath release.zip
- name: Upload built executable to Release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}