Skip to content

Commit

Permalink
Merge pull request #53 from gini/tidy-up-dexter
Browse files Browse the repository at this point in the history
fix&bring the CI update to date, document the release workflow
  • Loading branch information
danielpodwysocki-gini authored Oct 21, 2024
2 parents 83b6a99 + 96e230c commit 9aae96a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 26 deletions.
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.

0 comments on commit 9aae96a

Please sign in to comment.