Skip to content

Commit

Permalink
fix: setup automatic asset publishing
Browse files Browse the repository at this point in the history
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
  • Loading branch information
moul committed Jan 3, 2022
1 parent 242a103 commit 8de0e1a
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 9 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
strategy:
matrix:
golang:
- 1.15.x
- 1.16.x
- 1.17.x
steps:
- uses: actions/checkout@v2
- name: Install Go
Expand All @@ -47,8 +47,8 @@ jobs:
strategy:
matrix:
golang:
- 1.15.x
- 1.16.x
- 1.17.x
steps:
- uses: actions/checkout@v2
- name: Install Go
Expand All @@ -73,6 +73,7 @@ jobs:
- 1.14.x
- 1.15.x
- 1.16.x
- 1.17.x
steps:
- uses: actions/checkout@v2
- name: Install Go
Expand Down
63 changes: 56 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,62 @@
name: Semantic Release

on: push
name: Release
on:
push:
branches:
- master
- main

jobs:
semantic-release:
release:
name: releaser
runs-on: ubuntu-latest
strategy:
matrix:
golang: [1.17.x]
steps:
- uses: actions/checkout@master
- uses: codfish/semantic-release-action@v1.9.0
if: github.ref == 'refs/heads/master'
-
name: Checkout
uses: actions/checkout@v2.4.0
-
name: Unshallow
run: git fetch --prune --unshallow
-
uses: moul/repoman-action@v1
id: repoman
-
name: Run Semantic Release
id: semantic
uses: docker://ghcr.io/codfish/semantic-release-action:v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Set up Go
if: steps.semantic.outputs.new-release-published == 'true' && steps.repoman.outputs.has-go-binary == 'true'
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.golang }}
-
name: Cache Go modules
if: steps.semantic.outputs.new-release-published == 'true' && steps.repoman.outputs.has-go-binary == 'true'
uses: actions/cache@v2.1.7
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.golang }}-v1-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ matrix.golang }}-v1-
-
name: Run GoReleaser
if: steps.semantic.outputs.new-release-published == 'true' && steps.repoman.outputs.has-go-binary == 'true'
uses: goreleaser/goreleaser-action@v2.8.0
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Register version on pkg.go.dev
if: steps.semantic.outputs.new-release-published == 'true'
run: |
package=$(cat go.mod | grep ^module | awk '{print $2}')
version=v${{ steps.semantic.outputs.release-version }}
url=https://proxy.golang.org/${package}/@v/${version}.info
set -x +e
curl -i $url

0 comments on commit 8de0e1a

Please sign in to comment.