Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 35 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
name: Publish Binaries on Release

on:
release:
types: [created]
pull_request:
push:
# run only against tags
tags:
- "*"

permissions:
contents: write
packages: write
contents: read

jobs:
release-tailscale-s3-proxy:
strategy:
matrix:
os:
- linux
- darwin
arch:
- arm64
- amd64
name: release ${{ matrix.os }}/${{ matrix.arch}}
goreleaser:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
env:
flags: ""
steps:
- uses: actions/checkout@v4
- uses: wangyoucao577/go-release-action@2aa2977ad6a4534f9179e22bd0ff146a1e1d3466 # v1.52
- name: Checkout
uses: actions/checkout@v4
with:
binary_name: tailscale-s3-proxy
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.os }}
goarch: ${{ matrix.arch }}
fetch-depth: 0
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable

- name: Configure GoReleaser
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: echo "flags=--snapshot" >> "$GITHUB_ENV"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
# 'latest', 'nightly', or a semver
version: "~> v2"
args: release --clean ${{ env.flags }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bin/
vendor/

# Added by goreleaser init:
dist/
53 changes: 53 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 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: 2

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...

builds:
- env:
- CGO_ENABLED=0
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

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

release:
footer: >-

---

Released by [GoReleaser](https://github.com/goreleaser/goreleaser).
Loading