mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
Merge pull request #375 from daief/master
Github Actions add a release for macOS
This commit is contained in:
commit
77e6cd9faa
@ -1,16 +1,39 @@
|
|||||||
name: 'Mayhem for API'
|
name: ci
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [ master ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master]
|
branches: [ master ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
name: 'Unit- & API tests'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Set up Go 1.x
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ^1.18
|
||||||
|
id: go
|
||||||
|
|
||||||
|
- name: Check out code into the Go module directory
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Get dependencies
|
||||||
|
run: go get
|
||||||
|
|
||||||
|
- name: Unit Tests
|
||||||
|
run: go test ./... -run ./...
|
||||||
|
|
||||||
|
- name: API Tests
|
||||||
|
run: |
|
||||||
|
npm -g install newman
|
||||||
|
./testing/run_api_tests.sh
|
||||||
|
|
||||||
|
mapi:
|
||||||
|
name: 'Automated pen-tests with Mayhem for API'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
fail-fast: true
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go 1.x
|
- name: Set up Go 1.x
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
@ -50,3 +73,28 @@ jobs:
|
|||||||
uses: github/codeql-action/upload-sarif@v1
|
uses: github/codeql-action/upload-sarif@v1
|
||||||
with:
|
with:
|
||||||
sarif_file: mapi.sarif
|
sarif_file: mapi.sarif
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: 'Build (Win, Linux, Mac)'
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Set up Go 1.x
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ^1.18
|
||||||
|
id: go
|
||||||
|
|
||||||
|
- name: Check out code into the Go module directory
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Get dependencies
|
||||||
|
run: go get
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: go build -v .
|
1
.github/workflows/docker.yml
vendored
1
.github/workflows/docker.yml
vendored
@ -8,6 +8,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-publish:
|
docker-publish:
|
||||||
|
name: 'Build and publish Docker image'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
|
55
.github/workflows/linux-build-on-release.yml
vendored
55
.github/workflows/linux-build-on-release.yml
vendored
@ -1,55 +0,0 @@
|
|||||||
name: Linux
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
pull_request:
|
|
||||||
release:
|
|
||||||
types:
|
|
||||||
- published
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-release:
|
|
||||||
name: Linux - Build, Test & Release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Set up Go 1.x
|
|
||||||
uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: ^1.18
|
|
||||||
id: go
|
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Get dependencies
|
|
||||||
run: go get
|
|
||||||
|
|
||||||
- name: Unit Tests
|
|
||||||
run: go test ./... -run ./...
|
|
||||||
|
|
||||||
- name: API Tests
|
|
||||||
run: |
|
|
||||||
npm -g install newman
|
|
||||||
./testing/run_api_tests.sh
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: GO111MODULE=on go build -v .
|
|
||||||
|
|
||||||
- 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 }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ github.event.release.upload_url }}
|
|
||||||
asset_path: release.zip
|
|
||||||
asset_name: wakapi_linux_amd64.zip
|
|
||||||
asset_content_type: application/gzip
|
|
56
.github/workflows/release.yml
vendored
Normal file
56
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- published
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: 'Build, package and release to GitHub'
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
include:
|
||||||
|
- platform: ubuntu-latest
|
||||||
|
alias: linux
|
||||||
|
- platform: macos-latest
|
||||||
|
alias: mac
|
||||||
|
- platform: windows-latest
|
||||||
|
alias: win
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Set up Go 1.x
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ^1.18
|
||||||
|
id: go
|
||||||
|
|
||||||
|
- name: Check out code into the Go module directory
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Get dependencies
|
||||||
|
run: go get
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: go build -v .
|
||||||
|
|
||||||
|
- 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 wakapi_${{ matrix.alias }}_amd64.zip
|
||||||
|
- name: Compress working folder on Unix
|
||||||
|
if: runner.os != 'Windows'
|
||||||
|
run: |
|
||||||
|
cp config.default.yml config.yml
|
||||||
|
zip -9 wakapi_${{ matrix.alias }}_amd64.zip wakapi config.yml
|
||||||
|
|
||||||
|
- name: Upload built executable to Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
files: wakapi_${{ matrix.alias }}_amd64.zip
|
51
.github/workflows/win-build-on-release.yml
vendored
51
.github/workflows/win-build-on-release.yml
vendored
@ -1,51 +0,0 @@
|
|||||||
name: Windows
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
pull_request:
|
|
||||||
release:
|
|
||||||
types:
|
|
||||||
- published
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-release:
|
|
||||||
name: Windows - Build & Release
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Set up Go 1.x
|
|
||||||
uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: ^1.18
|
|
||||||
id: go
|
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Get dependencies
|
|
||||||
run: |
|
|
||||||
go get
|
|
||||||
|
|
||||||
- name: Enable Go 1.11 modules
|
|
||||||
run: cmd /c "set GO111MODULE=on"
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: go build -v .
|
|
||||||
|
|
||||||
- name: Compress working folder
|
|
||||||
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 }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ github.event.release.upload_url }}
|
|
||||||
asset_path: release.zip
|
|
||||||
asset_name: wakapi_win_amd64.zip
|
|
||||||
asset_content_type: application/gzip
|
|
Loading…
x
Reference in New Issue
Block a user