Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
4099ae5b47
|
|||
|
643704d542
|
|||
|
265107b66b
|
37
.github/workflows/go-releaser.yml
vendored
37
.github/workflows/go-releaser.yml
vendored
@@ -1,37 +0,0 @@
|
||||
name: goreleaser
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: stable
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v5
|
||||
with:
|
||||
distribution: goreleaser
|
||||
version: latest
|
||||
args: release --clean
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Update latest tag
|
||||
run: |
|
||||
git tag -f latest
|
||||
git push -f origin latest
|
||||
106
.goreleaser.yml
106
.goreleaser.yml
@@ -1,106 +0,0 @@
|
||||
# This is a GoReleaser configuration file
|
||||
# For more information about configuration options, visit:
|
||||
# https://goreleaser.com/customization/
|
||||
|
||||
version: 2
|
||||
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
|
||||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
flags:
|
||||
- -trimpath
|
||||
ldflags:
|
||||
- -s -w
|
||||
- -X git.mvl.sh/vleeuwenmenno/sshtunnel/cmd.Version={{.Version}}
|
||||
- -X git.mvl.sh/vleeuwenmenno/sshtunnel/cmd.BuildDate={{.Date}}
|
||||
mod_timestamp: "{{ .CommitTimestamp }}"
|
||||
|
||||
archives:
|
||||
- format: tar.gz
|
||||
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 }}
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
|
||||
checksum:
|
||||
name_template: "checksums.txt"
|
||||
|
||||
snapshot:
|
||||
name_template: "{{ incpatch .Version }}-next"
|
||||
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- "^docs:"
|
||||
- "^test:"
|
||||
|
||||
# Homebrew formula
|
||||
brews:
|
||||
- repository:
|
||||
owner: vleeuwenmenno
|
||||
name: homebrew-tap
|
||||
token: "{{ .Env.GITHUB_TOKEN }}"
|
||||
directory: Formula
|
||||
homepage: "https://git.mvl.sh/vleeuwenmenno/sshtunnel"
|
||||
description: "SSH tunnel manager CLI tool"
|
||||
license: "MIT"
|
||||
commit_author:
|
||||
name: goreleaserbot
|
||||
email: goreleaser@carlosbecker.com
|
||||
install: |
|
||||
bin.install "sshtunnel"
|
||||
|
||||
# Generate shell completions
|
||||
output = Utils.safe_popen_read("#{bin}/sshtunnel", "completion", "bash")
|
||||
(bash_completion/"sshtunnel").write output
|
||||
|
||||
output = Utils.safe_popen_read("#{bin}/sshtunnel", "completion", "zsh")
|
||||
(zsh_completion/"_sshtunnel").write output
|
||||
|
||||
output = Utils.safe_popen_read("#{bin}/sshtunnel", "completion", "fish")
|
||||
(fish_completion/"sshtunnel.fish").write output
|
||||
test: |
|
||||
system "#{bin}/sshtunnel", "version"
|
||||
|
||||
# .deb and .rpm packages
|
||||
nfpms:
|
||||
- file_name_template: "{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
|
||||
id: packages
|
||||
homepage: https://git.mvl.sh/vleeuwenmenno/sshtunnel
|
||||
description: |-
|
||||
SSH tunnel manager CLI tool
|
||||
maintainer: Menno van Leeuwen
|
||||
license: MIT
|
||||
vendor: vleeuwenmenno
|
||||
formats:
|
||||
- deb
|
||||
- rpm
|
||||
dependencies:
|
||||
- openssh-client
|
||||
recommends:
|
||||
- bash-completion
|
||||
scripts:
|
||||
postinstall: |
|
||||
sshtunnel completion bash > /usr/share/bash-completion/completions/sshtunnel
|
||||
sshtunnel completion zsh > /usr/share/zsh/site-functions/_sshtunnel
|
||||
sshtunnel completion fish > /usr/share/fish/vendor_completions.d/sshtunnel.fish
|
||||
chmod 644 /usr/share/bash-completion/completions/sshtunnel || true
|
||||
chmod 644 /usr/share/zsh/site-functions/_sshtunnel || true
|
||||
chmod 644 /usr/share/fish/vendor_completions.d/sshtunnel.fish || true
|
||||
@@ -81,7 +81,9 @@ log_and_run git push origin "$NEXT_VERSION"
|
||||
|
||||
# Update the latest tag
|
||||
printfe "%s\n" "cyan" "Updating 'latest' tag..."
|
||||
log_and_run git tag -f latest "$NEXT_VERSION"
|
||||
# Get the commit that the new version tag points to
|
||||
COMMIT_HASH=$(git rev-parse "$NEXT_VERSION")
|
||||
log_and_run git tag -f latest "$COMMIT_HASH"
|
||||
log_and_run git push -f origin latest
|
||||
|
||||
printfe "%s\n" "green" "Successfully tagged and pushed version $NEXT_VERSION"
|
||||
|
||||
Reference in New Issue
Block a user