Skip to content

Commit

Permalink
Release GHA for tyson and typeid (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
loreto committed Jun 27, 2023
1 parent 07eeb46 commit 6280083
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: release

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

on:
# Build/Release on demand
workflow_dispatch:
push:
tags:
- "*" # Tags that trigger a new release version

permissions:
contents: write
pull-requests: read

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Monorepo
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4

- name: Release with goreleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
project_name: typeid

before:
hooks:
- go mod tidy

builds:
- main: ./main.go
binary: typeid
flags:
- -trimpath
mod_timestamp: "{{ .CommitTimestamp }}" # For reproducible builds
ldflags:
- -s -w # Strip debug symbols
env:
- CGO_ENABLED=0
- GO111MODULE=on
goos:
- darwin
- linux
- windows
goarch:
- "386"
- amd64
- arm
- arm64
ignore:
- goos: darwin
goarch: "386"

archives:
- files:
- no-files-will-match-* # Glob that does not match to create archive with only binaries.
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"

checksum:
name_template: "checksums.txt"
algorithm: sha256

release:
prerelease: auto
draft: true
github:
owner: jetpack-io
name: typeid

snapshot:
name_template: "{{ .Tag }}-devel"

0 comments on commit 6280083

Please sign in to comment.