Skip to content

Commit

Permalink
add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
amalshaji committed Mar 5, 2024
1 parent 0416c16 commit 35b52fa
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Publish packages

on:
push:
# run only against tags
tags:
- "*"

permissions:
contents: write
# packages: write
# issues: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags

- name: Setup go
uses: actions/setup-go@v3
with:
go-version: ">=1.22"
cache: true

- name: Publish packages
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
# docker:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0

# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2

# - name: Docker meta
# id: meta
# uses: docker/metadata-action@v4
# with:
# images: |
# amalshaji/beaver
# tags: |
# type=semver,pattern={{version}}

# - name: Login to Docker Hub
# uses: docker/login-action@v2
# with:
# username: amalshaji
# password: ${{ secrets.DOCKERHUB_TOKEN }}

# - name: Build and push
# uses: docker/build-push-action@v4
# with:
# context: .
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# platforms: |
# linux/amd64
# linux/arm64
# file: deployments/Dockerfile
62 changes: 62 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
builds:
- id: "portr"
main: ./cmd/portr
binary: "portr"
dir: tunnel
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
ldflags:
- -s -w -X main.build={{.Version}}

archives:
- format: zip
name_template: >-
{{ .Binary }}_
{{- .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
id: portr

checksum:
name_template: "checksums.txt"

snapshot:
name_template: "{{ incpatch .Version }}-next"

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

release:
name_template: "v{{ .Version }}"
draft: true
footer: |
## Server docker images
https://hub.docker.com/r/amalshaji/portr/tags
brews:
- name: portr
ids:
- portr
homepage: https://github.com/amalshaji/portr
repository:
owner: amalshaji
name: homebrew-taps
token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
commit_author:
name: Amal Shaji
email: [email protected]

0 comments on commit 35b52fa

Please sign in to comment.