Skip to content

Commit

Permalink
chore: release and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Mar 19, 2022
1 parent 43ab6dc commit 231b789
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 13 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
branches:
- master
tags:
- v*
pull_request:

jobs:
Expand Down Expand Up @@ -54,13 +52,3 @@ jobs:

- name: Make
run: make

# https://goreleaser.com/ci/actions/
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_REPO }}
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Release a tag"
on:
push:
tags:
- v*

jobs:
release:
name: Release Process
runs-on: ubuntu-latest
env:
GO_VERSION: 1.17
CGO_ENABLED: 0

steps:

# https://github.com/marketplace/actions/setup-go-environment
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}

# https://github.com/marketplace/actions/checkout
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0

# https://github.com/marketplace/actions/cache
- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-release-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-release-

# https://goreleaser.com/ci/actions/
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_REPO }}
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ changelog:
- '^docs:'
- '^doc:'
- '^chore:'
- '^chore\(deps\):'
- '^test:'
- '^tests:'

Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ test: clean

check:
golangci-lint run

image:
docker build -t ldez/gha-mjolnir:latest .
docker tag ldez/gha-mjolnir:latest ldez/gha-mjolnir:${VERSION}

publish-image:
docker push ldez/gha-mjolnir:latest
docker push ldez/gha-mjolnir:${VERSION}
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Useful:
- to close issues related to a pull request not based on the default branch (i.e. `master`).
For example, when a branch is related to version (e.g. `v1.5`, `v2.0`, ...)

## Supported Syntaxes
## Supported Syntax

- prefixes (case insensitive): `close`, `closes`, `closed`, `fix`, `fixes`, `fixed`, `resolve`, `resolves`, `resolved`
- issues references separators (can be mixed): ` ` (space), `,` (period)
Expand Down

0 comments on commit 231b789

Please sign in to comment.