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