Skip to content

Commit

Permalink
fix(ci): build and release binary
Browse files Browse the repository at this point in the history
  • Loading branch information
genofire committed Jul 18, 2024
1 parent 9255831 commit 99eebc8
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Docs

on:
push:
branches:
- main

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
Expand Down
29 changes: 28 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Test, Lint
name: Golang

on:
push:
pull_request:
release:

jobs:
test:
Expand Down Expand Up @@ -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_*
15 changes: 12 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

name: Release

on:
workflow_run:
workflows:
- "Test, Lint"
- "Docs"
- "Golang"
types: [ "completed" ]
branches:
- main
- rc

permissions:
contents: read # for checkout
attestations: read # for artifacts download

jobs:
release:
Expand All @@ -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 }}
Expand Down
6 changes: 5 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
],
[
"@semantic-release/github",
{}
{
"assets": [
{ "path": "build/yanic*" }
]
}
]
]
}

0 comments on commit 99eebc8

Please sign in to comment.