-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add goreleaser and CLI publish workflow
- Loading branch information
1 parent
650b556
commit 339baaf
Showing
4 changed files
with
77 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Publish Release CLI | ||
|
||
on: | ||
push: | ||
tags: | ||
- cli/v* | ||
release: | ||
types: | ||
- published | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
- name: Set VERSION | ||
run: | | ||
TAG="${{ github.event.inputs.version || github.ref_name }}" | ||
# Get rid of the tag since the cli/ prefix confuses goreleaser. | ||
git tag -d $TAG | ||
echo VERSION=${TAG#cli/v} >> $GITHUB_ENV | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
distribution: goreleaser | ||
version: '~> v2' | ||
args: release --clean --snapshot --verbose | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload assets | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release | ||
path: dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: 2 | ||
snapshot: | ||
name_template: '{{.Env.VERSION}}' | ||
builds: | ||
- id: cli | ||
main: ./cli | ||
no_unique_dist_dir: true | ||
binary: fput-{{.Os}}-{{.Arch}} | ||
archives: | ||
- format: binary | ||
nfpms: | ||
- id: cli | ||
package_name: fluffy | ||
builds: | ||
- cli | ||
homepage: 'https://github.com/chriskuehl/fluffy' | ||
maintainer: 'Chris Kuehl <[email protected]>' | ||
description: 'command-line tools for uploading to fluffy servers' | ||
license: Apache-2.0 | ||
formats: | ||
- deb | ||
- rpm | ||
- archlinux | ||
contents: | ||
- src: /usr/bin/fput-{{.Os}}-{{.Arch}} | ||
dst: /usr/bin/fpb | ||
type: symlink | ||
- src: /usr/bin/fput-{{.Os}}-{{.Arch}} | ||
dst: /usr/bin/fput | ||
type: symlink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters