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:
commit
b2a3579be9
23
.github/workflows/linux-build-on-release.yml
vendored
23
.github/workflows/linux-build-on-release.yml
vendored
@ -1,13 +1,15 @@
|
|||||||
name: Build Wakapi on Linux
|
name: Build Wakapi on Linux
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- created
|
- created
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-release:
|
build-and-release:
|
||||||
name: Build and add to Release
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
@ -22,18 +24,21 @@ jobs:
|
|||||||
|
|
||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
run: |
|
run: |
|
||||||
go get -v -t -d ./...
|
go get github.com/markbates/pkger/cmd/pkger
|
||||||
|
go get
|
||||||
|
go generate
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: GO111MODULE=on go build -v .
|
run: GO111MODULE=on go build -v .
|
||||||
|
|
||||||
- name: Zip Release
|
- name: Zip executable and sample config
|
||||||
uses: TheDoctor0/zip-release@v0.3.0
|
if: github.event_name == 'release'
|
||||||
with:
|
run: |
|
||||||
filename: release.zip
|
cp config.default.yml config.yml
|
||||||
exclusions: '*.git*'
|
zip -9 release.zip wakapi config.yml
|
||||||
|
|
||||||
- name: Upload built executable to Release
|
- name: Upload built executable to Release
|
||||||
|
if: github.event_name == 'release'
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
uses: actions/upload-release-asset@v1.0.2
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
20
.github/workflows/win-build-on-release.yml
vendored
20
.github/workflows/win-build-on-release.yml
vendored
@ -1,13 +1,15 @@
|
|||||||
name: Build Wakapi on Windows
|
name: Build Wakapi on Windows
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- created
|
- created
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-release:
|
build-and-release:
|
||||||
name: Build and add to release
|
name: Build
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
@ -22,18 +24,24 @@ jobs:
|
|||||||
|
|
||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
run: |
|
run: |
|
||||||
go get -v -t -d ./...
|
go get github.com/markbates/pkger/cmd/pkger
|
||||||
|
go get
|
||||||
|
go generate
|
||||||
|
|
||||||
- name: Enable Go 1.11 modules
|
- name: Enable Go 1.11 modules
|
||||||
run: cmd /c "set GO111MODULE=on"
|
run: cmd /c "set GO111MODULE=on"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: go build -v .
|
run: go build -v .
|
||||||
|
|
||||||
- name: Compress working folder
|
- 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
|
- name: Upload built executable to Release
|
||||||
|
if: github.event_name == 'release'
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
uses: actions/upload-release-asset@v1.0.2
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
Loading…
Reference in New Issue
Block a user