Release commit
This commit is contained in:
29
.github/workflows/release.yml
vendored
29
.github/workflows/release.yml
vendored
@@ -29,16 +29,13 @@ jobs:
|
||||
goarch: arm64
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
|
||||
- name: Build ${{ matrix.goos }}_${{ matrix.goarch }}
|
||||
- name: Build binary
|
||||
env:
|
||||
GOOS: ${{ matrix.goos }}
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
@@ -48,20 +45,16 @@ jobs:
|
||||
outfile="${BINARY_NAME}_${{ matrix.goos }}_${{ matrix.goarch }}"
|
||||
go build -o "dist/${outfile}" .
|
||||
|
||||
- name: Upload binary
|
||||
- name: Upload binary artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: binaries_${{ matrix.goos }}_${{ matrix.goarch }}
|
||||
name: bin_${{ matrix.goos }}_${{ matrix.goarch }}
|
||||
path: dist/${{ env.BINARY_NAME }}_${{ matrix.goos }}_${{ matrix.goarch }}
|
||||
if-no-files-found: error
|
||||
|
||||
|
||||
source:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -71,13 +64,12 @@ jobs:
|
||||
tag="${GITHUB_REF_NAME}"
|
||||
tar -czf "dist/${{ env.BINARY_NAME }}_${tag}_source.tar.gz" .
|
||||
|
||||
- name: Upload source
|
||||
- name: Upload source artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: source
|
||||
path: dist/*source.tar.gz
|
||||
|
||||
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build, source]
|
||||
@@ -85,14 +77,17 @@ jobs:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Download all artifacts flat
|
||||
- name: Download ALL artifacts to dist/
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: dist
|
||||
merge-multiple: true
|
||||
|
||||
- name: Publish to GitHub release
|
||||
- name: Force-create GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
draft: false
|
||||
prerelease: false
|
||||
generate_release_notes: true
|
||||
tag_name: ${{ github.ref_name }}
|
||||
files: dist/*
|
||||
|
||||
Reference in New Issue
Block a user