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 cb7a2fe
Show file tree
Hide file tree
Showing 4 changed files with 38 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
22 changes: 21 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,22 @@ jobs:
version: latest
skip-cache: true
args: --timeout=5m

build:
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
env:
CGO_ENABLED: 0
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: build
path: yanic
13 changes: 10 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

name: Release

on:
workflow_run:
workflows:
- "Test, Lint"
- "Docs"
- "Golang"
types: [ "completed" ]
branches:
- main
Expand Down Expand Up @@ -38,6 +37,14 @@ 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 }}

- 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 cb7a2fe

Please sign in to comment.