Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish to Go Mod on Repo Tag #39

Merged
merged 1 commit into from
Nov 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/go-cicd.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
on: [push]
name: go-cicd

# TODO: add go module publishing
# maybe, curl https://sum.golang.org/lookup/github.com/eduncan911/podcast@v1.4.2
#
on: [push]

jobs:

lint:
runs-on: ubuntu-latest
steps:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/go-mod-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: go-mod-publish
on:
push:
tags:
- 'v*.*.*'

# This will force a go mod to update its cache when a tag is created.

jobs:
publish-tag:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v1
- name: Grab latest Tag from Git
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Debug Vars
run: |
echo "RELEASE_VERSION=${RELEASE_VERSION}"
echo "GITHUB_REPOSITORY=${GITHUB_REPOSITORY}"
echo "https://sum.golang.org/lookup/github.com/${GITHUB_REPOSITORY}@${RELEASE_VERSION}"
- name: Publish Tag to Go Mod
shell: bash
run: |
curl https://sum.golang.org/lookup/github.com/${GITHUB_REPOSITORY}@${RELEASE_VERSION}