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

fix&bring the CI update to date, document the release workflow #53

Merged
merged 6 commits into from
Oct 21, 2024
Merged
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
33 changes: 21 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,32 @@ on:
pull_request:
branches: [ master ]

jobs:
permissions:
contents: write

build:
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
-
name: Checkout
uses: actions/checkout@v4
with:
go-version: 1.17

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.2
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: build --skip-validate --rm-dist --snapshot
version: 'latest'
# --snapshot's goal is to ignore the existing tagging.
# We are just veryfying this builds, we don't intend to release in this step.
# validate refers to git tags - we don't need to check semver at this stage yet.
args: build --clean --snapshot --skip validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 17 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,33 @@ name: Release
on:
push:
tags:
- '*'
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.17

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
go-version: 1.23.2
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --rm-dist
version: 'latest'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

6 changes: 3 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
version: 2

before:
hooks:
# You may remove this if you don't use go modules.
Expand Down Expand Up @@ -41,7 +41,7 @@ archives:
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
version_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
Expand Down
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## release workflow

We use a combination of [GitHub Actions](https://docs.github.com/en/actions) and [goreleaser](https://goreleaser.com/)

Configurations for those shouldn't generally require adjusting, but if they do, they are found underneath `.github` and `.goreleaser.yml`

In order to release:

1) Merge your changes to master
2) Push a tag following semVer. If you are unsure of what version to assign, you can find the concepts described here: https://semver.org/
3) Verify the github action defined in .github/ completed and a new release is available. You can see the status in the github web UI.

Loading