Skip to content

Commit

Permalink
ci(.github/workflows): create release CI workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Di Donato <[email protected]>
  • Loading branch information
leodido committed Feb 27, 2023
1 parent a269fa6 commit ea29a18
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: building

on:
push:
branches: ['ci/build-workflow']
branches: ['develop']
pull_request:
branches: ['ci/build-workflow']
branches: ['develop']

jobs:
build:
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: releasing

on:
push:
tags:
- "v*"

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Check out the source code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Avoid running against a shallow clone

- name: Force fetch upstream tags
run: git fetch --force --tags

- name: Restore the Go modules cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: go-${{ runner.os }}-${{ hashFiles('go.mod') }}
restore-keys: |
go-${{ runner.os }}-
- name: Release
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ release:
before:
hooks:
- go mod tidy
- make

builds:
- skip: true
Expand Down

0 comments on commit ea29a18

Please sign in to comment.