Merge pull request #1 from comnoco/rename #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
name: releaser | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/[email protected] | |
- | |
name: Unshallow | |
run: git fetch --prune --unshallow | |
- | |
name: Run Semantic Release | |
id: semantic | |
uses: codfish/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Set up Go | |
if: steps.semantic.outputs.new-release-published == 'true' | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.23.1 | |
- | |
name: Cache Go modules | |
if: steps.semantic.outputs.new-release-published == 'true' | |
uses: actions/[email protected] | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- | |
name: Run GoReleaser | |
if: steps.semantic.outputs.new-release-published == 'true' | |
uses: goreleaser/[email protected] | |
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 |