-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (34 loc) · 1.48 KB
/
release.yml
File metadata and controls
42 lines (34 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- name: Get version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build binaries
run: |
mkdir -p dist
# Build for multiple platforms
GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X main.version=${{ steps.version.outputs.VERSION }}" -o dist/logfire_pg-linux-amd64 ./cmd/logfire_pg
GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -X main.version=${{ steps.version.outputs.VERSION }}" -o dist/logfire_pg-linux-arm64 ./cmd/logfire_pg
# GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X main.version=${{ steps.version.outputs.VERSION }}" -o dist/logfire_pg-darwin-amd64 ./cmd/logfire_pg
# GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -X main.version=${{ steps.version.outputs.VERSION }}" -o dist/logfire_pg-darwin-arm64 ./cmd/logfire_pg
GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X main.version=${{ steps.version.outputs.VERSION }}" -o dist/logfire_pg-windows-amd64.exe ./cmd/logfire_pg
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
generate_release_notes: true