Skip to content

Commit

Permalink
build and release
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyiming748 committed Nov 30, 2023
1 parent 58af3b5 commit 8d257d5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go
name: go

on:
push:
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
run: CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -v -o /home/runner/work/processAll/exec/process4M1 /home/runner/work/processAll/processAll/main.go
- name: Build for android/arm64
run: CGO_ENABLED=0 GOOS=android GOARCH=arm64 go build -v -o /home/runner/work/processAll/exec/process4android /home/runner/work/processAll/processAll/main.go
- name: Build for android/arm64
- name: show build file
run: ls -alhtSF /home/runner/work/processAll/exec
# - name: Test
# run: go test -v ./...
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: release

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: write
packages: write

jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
goos: [linux, windows, darwin,android]
goarch: ["386", amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
- goarch: arm64
goos: android
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://dl.google.com/go/go1.21.4.linux-amd64.tar.gz"
project_path: "./cmd/test-binary"
binary_name: "test-binary"
extra_files: LICENSE README.md

0 comments on commit 8d257d5

Please sign in to comment.