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 bafb32b
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Test, Lint
on:
push:
pull_request:
release:

jobs:
test:
Expand Down Expand Up @@ -64,3 +65,45 @@ 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

release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs:
- lint
- test
- build
steps:
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: build
path: build/
- name: Upload binaries to release
uses: Shopify/upload-to-release@v2
env:
GITHUB_TOKEN:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
name: yanic
path: build/yanic
content-type: "application/octet-stream"

0 comments on commit bafb32b

Please sign in to comment.