Skip to content

Commit

Permalink
Use GHA to publish release
Browse files Browse the repository at this point in the history
  • Loading branch information
foxish committed Dec 1, 2023
1 parent fc3b99f commit ff45d44
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 15 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release Signadot CLI
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]'
env:
GO_VERSION: "1.21"

jobs:
release-cli:
name: "Release CLI"
env:
GOPRIVATE: github.com/signadot/libconnect
GH_ACCESS_TOKEN: ${{ secrets.SIGNADOT_GHA_GOBUILD_PAT }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Use a depth of 0 to fetch full history. This is the only way to fetch
# tags, needed to choose a version number to embed.
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Prepare for GOPRIVATE
run: |
git config --global url.https://$GH_ACCESS_TOKEN@github.com/.insteadOf https://github.com/
- name: Docker Login
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

# run goreleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: 1.22.1
args: release --clean
env:
SIGNADOT_IMAGE_SUFFIX: ''
GITHUB_TOKEN: ${{ secrets.SIGNADOT_GHA_GOBUILD_PAT }}
18 changes: 3 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,9 @@ go build ./cmd/signadot

## Release

To release the CLI, you'll need [GoReleaser](https://goreleaser.com/) as well as
a GiHtub token with write permissions to Signadot's repos.

Check out the desired commit and then push a new tag:

```sh
git tag -a -m 'Release vX.Y.Z' vX.Y.Z
git push origin vX.Y.Z
```

Then run GoReleaser, which will build and push all release artifacts:

```sh
GITHUB_TOKEN=... make release
```
To release the CLI, you can use the release Github action.
Push a new tag that matches the format `v[0-9]+.[0-9]+.[0-9]`
and it will push new release artifacts and update brew.

## See Also

Expand Down

0 comments on commit ff45d44

Please sign in to comment.