-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
924829e
commit 36628c7
Showing
3 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
name: release | ||
permissions: | ||
contents: write | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Release version (e.g., v1.0.0)" | ||
required: true | ||
jobs: | ||
run: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
container: | ||
image: goreleaser/goreleaser:latest | ||
steps: | ||
- name: Install dependencies | ||
run: apk add --no-cache bash ncurses git | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- run: | | ||
git config --global --add safe.directory "$PWD" | ||
git fetch --force --tags | ||
- name: Create release tag | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Michael Henriksen" | ||
git tag -a "$VERSION" -m "$VERSION" | ||
env: | ||
VERSION: ${{ github.event.inputs.version }} | ||
- name: Run GoReleaser | ||
run: goreleaser release --clean | ||
env: | ||
VERSION: ${{ github.event.inputs.version }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Notify Go proxy about new release | ||
run: go list -m "github.com/michenriksen/tatt@${VERSION}" || true | ||
env: | ||
GOPROXY: proxy.golang.org | ||
VERSION: ${{ github.event.inputs.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,3 +113,5 @@ tags | |
|
||
# End of https://www.toptal.com/developers/gitignore/api/go,vim,visualstudiocode,macos,linux | ||
|
||
|
||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# This is an example .goreleaser.yml file with some sensible defaults. | ||
# Make sure to check the documentation at https://goreleaser.com | ||
|
||
# The lines below are called `modelines`. See `:help modeline` | ||
# Feel free to remove those if you don't want/need to use them. | ||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json | ||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj | ||
|
||
version: 1 | ||
project_name: tatt | ||
|
||
before: | ||
hooks: | ||
- go mod tidy | ||
|
||
builds: | ||
- id: tatt | ||
env: | ||
- CGO_ENABLED=0 | ||
main: ./cmd/tatt | ||
binary: tatt | ||
flags: | ||
- "-trimpath" | ||
asmflags: | ||
- "-D mysymbol" | ||
- "all=-trimpath={{.Env.GOPATH}}" | ||
ldflags: | ||
- "-s -w" | ||
- "-X github.com/michenriksen/tatt/internal/cli.version={{ .Version }}" | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
|
||
archives: | ||
- format: tar.gz | ||
# this name template makes the OS and Arch compatible with the results of `uname`. | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
{{- if .Arm }}v{{ .Arm }}{{ end }} | ||
# use zip for windows archives | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
files: | ||
- README.md | ||
- LICENSE | ||
|
||
checksum: | ||
name_template: "checksums.txt" | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
include: | ||
- "^feat[(:]" | ||
- "^fix[(:]" | ||
- "^build[(:]" | ||
|
||
release: | ||
draft: true | ||
replace_existing_draft: true | ||
discussion_category_name: General |