chore: add release workflow
This commit is contained in:
parent
3021ab8896
commit
c0cbb5d6c3
3 changed files with 48 additions and 8 deletions
.forgejo/workflows
|
@ -24,10 +24,6 @@ jobs:
|
|||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ steps.go-version.outputs.version }}
|
||||
-
|
||||
name: Build for host architecture
|
||||
run: |
|
||||
make build
|
||||
-
|
||||
name: Run tests
|
||||
run: |
|
||||
|
|
41
.forgejo/workflows/release.yaml
Normal file
41
.forgejo/workflows/release.yaml
Normal file
|
@ -0,0 +1,41 @@
|
|||
name: Build and upload project release
|
||||
|
||||
on:
|
||||
create:
|
||||
tags: [ v* ]
|
||||
|
||||
jobs:
|
||||
|
||||
release:
|
||||
runs-on: debian-12
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
-
|
||||
name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Extract Go version
|
||||
id: go-version
|
||||
run: |
|
||||
sed '/^go /!d; s/go /version=/' go.mod >>"$GITHUB_OUTPUT"
|
||||
-
|
||||
name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ steps.go-version.outputs.version }}
|
||||
-
|
||||
name: Run tests
|
||||
run: |
|
||||
make test
|
||||
-
|
||||
name: Build binaries
|
||||
run: |
|
||||
make dist-all
|
||||
-
|
||||
name: Upload release
|
||||
uses: actions/forgejo-release@v1
|
||||
with:
|
||||
direction: upload
|
||||
name: binaries
|
||||
release-dir: dist/release
|
||||
token: ${{ secrets.FORGEJO_TOKEN }}
|
Loading…
Add table
Add a link
Reference in a new issue