Skip to content

Commit

Permalink
GHA: Build with multi-version Go
Browse files Browse the repository at this point in the history
  • Loading branch information
hzyitc committed Oct 22, 2022
1 parent c590227 commit b0792e0
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,50 @@ on:

jobs:
build:
name: Build by Go${{ matrix.go-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version:
- 1.16
- 1.18
- 1.19

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: ${{ matrix.go-version }}

- name: Build
run: bash ./buildAllPlatforms.sh

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: bin
name: Go${{ matrix.go-version }}
path: bin/*

release:
name: Release the build by Go1.19
if: startsWith(github.ref, 'refs/tags')
needs: build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: Go1.19
path: bin/

- name: Release
if: startsWith(github.ref, 'refs/tags')
uses: softprops/action-gh-release@v1
with:
files:
Expand Down

0 comments on commit b0792e0

Please sign in to comment.