This commit is contained in:
58
.github/workflows/release.yml
vendored
58
.github/workflows/release.yml
vendored
@@ -1,54 +1,22 @@
|
|||||||
name: Build and Release Go Binary
|
name: Build and Release Go Binary
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
tags:
|
types: [created]
|
||||||
- "*"
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
release-linux-amd64:
|
||||||
name: Build Go Binary
|
name: release linux/amd64
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: 1.23
|
|
||||||
|
|
||||||
- name: Build Binary
|
|
||||||
run: |
|
|
||||||
mkdir -p dist
|
|
||||||
GOOS=linux GOARCH=amd64 go build -o dist/go-mines-linux-amd64 .
|
|
||||||
GOOS=windows GOARCH=amd64 go build -o dist/go-mines-windows-amd64.exe .
|
|
||||||
GOOS=darwin GOARCH=amd64 go build -o dist/go-mines-macos-amd64 .
|
|
||||||
|
|
||||||
- name: Upload Build Artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: go-mines-binaries
|
|
||||||
path: dist/*
|
|
||||||
|
|
||||||
release:
|
|
||||||
name: Create GitHub Release
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
- uses: wangyoucao577/go-release-action@v1
|
||||||
|
|
||||||
- name: Download Build Artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: go-mines-binaries
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
path: dist
|
goos: linux
|
||||||
|
goarch: amd64
|
||||||
|
|
||||||
- name: Create GitHub Release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
files: dist/*
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user