Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Goreleaser package management #47

Closed
wants to merge 2 commits into from
Closed
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
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Release
on:
push:
tags:
- "v*"
jobs:
goreleaser:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Setup Snapcraft
run: |
sudo snap install snapcraft --classic
snapcraft login --with - <<<"${SNAP_TOKEN}"
env:
SNAP_TOKEN: ${{ secrets.SNAP_LOGIN }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akram looks like this also needs to be added to the organization (we should coordinate offline)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

SNAPCRAFT_BUILD_ENVIRONMENT: host
akram marked this conversation as resolved.
Show resolved Hide resolved
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akram is this something we need to add to the organization?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's it.


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ _output/
/shp
/shp-*
/bin/*
dist/
59 changes: 59 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
before:
hooks:
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
main: ./cmd/shp/main.go
archives:
- replacements:
darwin: Darwin
linux: Linux
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
brews:
- tap:
name: shipwright-tap
owner: shipwright
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
url_template: "https://github.com/shipwright-io/cli/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
download_strategy: CurlDownloadStrategy
commit_author:
name: GoReleaser Bot
email: [email protected]
folder: HomebrewFormula
homepage: "https://github.com/shipwright-io/cli"
description: "shp is the command line for shipwright"
license: "MIT"
skip_upload: false
test: |
system "#{bin}/shipwright-cli help"

snapcrafts:
- id: shipwright-cli
publish: true
summary: "shp is the command line for shipwright"
description: "shp is the command line for shipwright"
grade: stable
confinement: strict
license: MIT
base: bare
apps:
shipwright-cli:
plugs: ["ci", "build"]