Skip to content

Commit

Permalink
ci: add goreleaser settings
Browse files Browse the repository at this point in the history
  • Loading branch information
supercaracal committed Dec 14, 2023
1 parent 6a75afc commit 064fd61
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
# @see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# @see https://github.com/actions/virtual-environments
name: Release
on:
push:
tags:
- "v*"
concurrency: ${{ github.workflow }}
jobs:
release:
name: Release
if: github.repository == 'livesense-inc/fanlin'
timeout-minutes: 10
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
cache: true

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
project_name: scram-sha-256

# https://goreleaser.com/customization/build/
# https://go.dev/doc/install/source#environment
builds:
- env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -s -w
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm
- arm64
# https://github.com/golang/go/wiki/GoArm
# https://www.cs.umd.edu/~meesh/cmsc411/website/proj01/arm/armchip.html
goarm:
- 6
- 7

# https://goreleaser.com/customization/archive/
archives:
- name_template: '{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}{{ with .Arm }}-v{{ . }}{{ end }}'
format: binary
replacements:
amd64: x86_64

0 comments on commit 064fd61

Please sign in to comment.