Skip to content

Commit

Permalink
feat: add snap release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ZinoKader committed Mar 14, 2023
1 parent 615198f commit 87d76fd
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
goreleaser:
release:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
steps:
- name: Checkout branch
uses: actions/checkout@v3
Expand All @@ -20,10 +23,11 @@ jobs:
with:
go-version: 1.20.1

- name: Setup Snapcraft
uses: samuelmeuli/action-snapcraft@v2

- name: Release with goreleaser
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
34 changes: 32 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
project_name: portal

before:
hooks:
- go mod tidy

builds:
- id: "portal-client-app"
main: ./cmd/portal
Expand All @@ -19,6 +21,7 @@ builds:
- netbsd
- openbsd
ldflags: -s -w -X main.version={{.Tag}} -X main.revision={{.ShortCommit}} -X main.date={{.Date}}

archives:
- format: tar.gz
format_overrides:
Expand All @@ -35,13 +38,14 @@ archives:
files:
- LICENSE
- CREDITS

nfpms:
- formats:
- apk
- deb
- rpm
vendor: "portal"
description: "Portal is a quick and easy command-line file transfer utility from any computer to another πŸ–₯️ 🌌 πŸ’»"
description: "Portal is a quick and easy command-line file transfer utility from any computer to another 🌌 ✨"
license: "MIT"
package_name: portal
replacements:
Expand All @@ -52,23 +56,49 @@ nfpms:
openbsd: OpenBSD
netbsd: NetBSD
freebsd: FreeBSD

brews:
- tap:
owner: SpatiumPortae
name: homebrew-portal
folder: Formula
homepage: "https://github.com/SpatiumPortae/portal"
description: "Portal is a quick and easy command-line file transfer utility from any computer to another πŸ–₯️ 🌌 πŸ’»"
description: "Portal is a quick and easy command-line file transfer utility from any computer to another 🌌 ✨"
license: "MIT"

snapcrafts:
- publish: true
summary: Quick and easy command-line file transfer utility from any computer to another.
description: |
Portal is a quick and easy command-line file transfer utility from any computer to another 🌌 ✨.
Transfers are fully encrypted, and made peer-to-peer if possible, with a fallback to a relay
server if not.
grade: stable
confinement: strict
license: MIT
apps:
portal:
command: portal
plugs: ["network", "network-bind", "network-observe", "network-status"]

release:
prerelease: auto

checksum:
name_template: "checksums.txt"

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

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^chore"
- "merge conflict"
- Merge pull request
- Merge remote-tracking branch
- Merge branch
- go mod tidy

0 comments on commit 87d76fd

Please sign in to comment.