workflows: simplify build configuration, use OS matrix
This commit is contained in:
parent
54849ef3e5
commit
740cf500fd
1 changed files with 22 additions and 91 deletions
113
.github/workflows/build.yml
vendored
113
.github/workflows/build.yml
vendored
|
@ -19,9 +19,12 @@ env:
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_cli_ubuntu:
|
build_cli:
|
||||||
name: Build CLI (Ubuntu)
|
name: Build CLI
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ${{matrix.os}}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-20.04, windows-2022]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -50,48 +53,17 @@ jobs:
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: neo-go-binaries-ubuntu
|
name: neo-go-binaries
|
||||||
path: ./bin/neo-go
|
path: ./bin/neo-go*
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
build_cli_wsc:
|
build_image:
|
||||||
name: Build CLI (Windows Server Core)
|
needs: build_cli
|
||||||
runs-on: windows-2022
|
name: Build Docker image
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
steps:
|
strategy:
|
||||||
- uses: actions/checkout@v2
|
matrix:
|
||||||
with:
|
os: [ubuntu-20.04, windows-2022]
|
||||||
ref: ${{ github.event.inputs.ref }}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: 1.18
|
|
||||||
|
|
||||||
- name: Restore Go modules from cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: /home/runner/go/pkg/mod
|
|
||||||
key: deps-${{ hashFiles('go.sum') }}
|
|
||||||
|
|
||||||
- name: Update Go modules
|
|
||||||
run: go mod download -json
|
|
||||||
|
|
||||||
- name: Build CLI
|
|
||||||
run: make build
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: neo-go-binaries-wsc
|
|
||||||
path: ./bin/neo-go.exe
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
build_image_ubuntu:
|
|
||||||
needs: build_cli_ubuntu
|
|
||||||
name: Build Docker image (Ubuntu)
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -108,54 +80,13 @@ jobs:
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: make image
|
run: make image
|
||||||
|
|
||||||
build_image_wsc:
|
build_privnet_image:
|
||||||
needs: build_cli_wsc
|
needs: build_cli
|
||||||
name: Build Docker image (Windows Server Core)
|
name: Build privnet Docker image
|
||||||
runs-on: windows-2022
|
runs-on: ${{matrix.os}}
|
||||||
|
strategy:
|
||||||
steps:
|
matrix:
|
||||||
- uses: actions/checkout@v2
|
os: [ubuntu-20.04, windows-2022]
|
||||||
with:
|
|
||||||
ref: ${{ github.event.inputs.ref }}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
# For proper `deps` make target execution.
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: 1.18
|
|
||||||
|
|
||||||
- name: Build Docker image
|
|
||||||
run: make image
|
|
||||||
|
|
||||||
build_privnet_image_ubuntu:
|
|
||||||
needs: build_cli_ubuntu
|
|
||||||
name: Build privnet Docker image (Ubuntu)
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.inputs.ref }}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
# For proper `deps` make target execution.
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: 1.18
|
|
||||||
|
|
||||||
# For information purposes.
|
|
||||||
- name: Print Docker version
|
|
||||||
run: docker --version
|
|
||||||
|
|
||||||
- name: Build privnet Docker image
|
|
||||||
run: make env_image
|
|
||||||
|
|
||||||
build_privnet_image_wsc:
|
|
||||||
needs: build_cli_wsc
|
|
||||||
name: Build privnet Docker image (Windows Server Core)
|
|
||||||
runs-on: windows-2022
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
Loading…
Reference in a new issue