mirror of
https://github.com/fankes/komari-agent.git
synced 2025-10-19 02:59:23 +08:00
fix: text 自动生成二进制
This commit is contained in:
72
.github/workflows/release.yml
vendored
72
.github/workflows/release.yml
vendored
@@ -1,57 +1,45 @@
|
|||||||
name: Release
|
name: Build and Attach Binaries to Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [created]
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-and-attach:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
goos: [windows, linux]
|
||||||
include:
|
goarch: [amd64, arm64]
|
||||||
- os: ubuntu-latest
|
|
||||||
artifact_name: komari-agent-linux-amd64
|
|
||||||
goos: linux
|
|
||||||
goarch: amd64
|
|
||||||
- os: ubuntu-latest
|
|
||||||
artifact_name: komari-agent-linux-arm64
|
|
||||||
goos: linux
|
|
||||||
goarch: arm64
|
|
||||||
- os: windows-latest
|
|
||||||
artifact_name: komari-agent-windows-amd64.exe
|
|
||||||
goos: windows
|
|
||||||
goarch: amd64
|
|
||||||
- os: windows-latest
|
|
||||||
artifact_name: komari-agent-windows-arm64.exe
|
|
||||||
goos: windows
|
|
||||||
goarch: arm64
|
|
||||||
- os: macos-latest
|
|
||||||
artifact_name: komari-agent-darwin-amd64
|
|
||||||
goos: darwin
|
|
||||||
goarch: amd64
|
|
||||||
- os: macos-latest
|
|
||||||
artifact_name: komari-agent-darwin-arm64
|
|
||||||
goos: darwin
|
|
||||||
goarch: arm64
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout code
|
||||||
with:
|
uses: actions/checkout@v4
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version: '1.23'
|
||||||
|
|
||||||
- name: Build
|
- name: Build binary
|
||||||
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ${{ matrix.artifact_name }} .
|
|
||||||
|
|
||||||
- name: Upload Release Asset
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
files: ${{ matrix.artifact_name }}
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GOOS: ${{ matrix.goos }}
|
||||||
|
GOARCH: ${{ matrix.goarch }}
|
||||||
|
run: |
|
||||||
|
BINARY_NAME=myapp-${{ matrix.goos }}-${{ matrix.goarch }}
|
||||||
|
if [ "${{ matrix.goos }}" = "windows" ]; then
|
||||||
|
BINARY_NAME=${BINARY_NAME}.exe
|
||||||
|
fi
|
||||||
|
go build -o $BINARY_NAME
|
||||||
|
|
||||||
|
- name: Upload binary to release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
BINARY_NAME=myapp-${{ matrix.goos }}-${{ matrix.goarch }}
|
||||||
|
if [ "${{ matrix.goos }}" = "windows" ]; then
|
||||||
|
BINARY_NAME=${BINARY_NAME}.exe
|
||||||
|
fi
|
||||||
|
gh release upload ${{ github.event.release.tag_name }} $BINARY_NAME --repo ${{ github.repository }}
|
||||||
|
shell: bash
|
Reference in New Issue
Block a user