fix(ci): build and release binary

This commit is contained in:
genofire 2024-07-18 11:12:13 +02:00
parent 9255831144
commit 99eebc8582
No known key found for this signature in database
GPG Key ID: FBF32CFFD052F863
4 changed files with 47 additions and 5 deletions

View File

@ -1,4 +1,5 @@
name: Docs
on:
push:
branches:
@ -6,6 +7,7 @@ on:
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest

View File

@ -1,8 +1,9 @@
name: Test, Lint
name: Golang
on:
push:
pull_request:
release:
jobs:
test:
@ -64,3 +65,29 @@ jobs:
version: latest
skip-cache: true
args: --timeout=5m
build:
strategy:
matrix:
include:
- arch: amd64
os: linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: '1.21'
- name: Build
run: go build -ldflags "-X github.com/FreifunkBremen/yanic/cmd.VERSION=$(git describe --tags)" -v -o yanic_${{ matrix.arch }}_${{ matrix.os }}
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 0
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: build-${{ matrix.arch }}-${{ matrix.os }}
path: yanic_*

View File

@ -1,10 +1,9 @@
name: Release
on:
workflow_run:
workflows:
- "Test, Lint"
- "Docs"
- "Golang"
types: [ "completed" ]
branches:
- main
@ -12,6 +11,7 @@ on:
permissions:
contents: read # for checkout
attestations: read # for artifacts download
jobs:
release:
@ -38,6 +38,15 @@ jobs:
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
pattern: build-*
path: build/
merge-multiple: true
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -22,7 +22,11 @@
],
[
"@semantic-release/github",
{}
{
"assets": [
{ "path": "build/yanic*" }
]
}
]
]
}