Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aofengli committed Jan 2, 2024
1 parent 09c9d78 commit ab9622e
Showing 1 changed file with 46 additions and 14 deletions.
60 changes: 46 additions & 14 deletions .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,57 @@
name: Release Binary
on:
release:
release:
types:
- created

env:
GO_VERSION: "1.19.x"

jobs:
build-go-binary:
build:
name: iris-${{ matrix.targetos }}-${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
matrix:
goos: [ linux, windows, darwin ] # 需要打包的系统
goarch: [ amd64, arm64 ] # 需要打包的架构
arch: [amd64, arm64]
targetos: [darwin, linux, windows]
include:
- targetos: darwin
arch: arm64
exclude:
- targetos: windows
arch: arm64
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
- name: Check out repository code
uses: actions/checkout@v4
- name: Get git diff
uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.wasm
!tests/**
**/**.go !**/*_test.go
go.mod
go.sum
Makefile
.github/workflows/release-binary.yml
- name: Setup Golang
uses: actions/setup-go@v5
if: env.GIT_DIFF
with:
go-version: ${{env.GO_VERSION}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}
- name: Download Dependencies
if: env.GIT_DIFF
run: go mod download
- name: Build iris
if: env.GIT_DIFF
run: |
GOWRK=off go build cmd/iris/main.go
- name: Upload iris artifact
if: env.GIT_DIFF
uses: actions/upload-artifact@v3
with:
go-version: '1.19.x'
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
binary_name: "iris"
name: iris-${{ matrix.targetos }}-${{ matrix.arch }}
path: cmd/iris/iris

0 comments on commit ab9622e

Please sign in to comment.