github: enable run goreleaser automatically when bump new tag
Change-Id: Ieedeb07dcacf8ff7e6ae58a86c7072af0caf3f78
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/4781
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..5120d99
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,23 @@
+name: Release
+
+on:
+ push:
+ tags:
+ - 'v*'
+
+jobs:
+ goreleaser:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Unshallow # required for the changelog to work correctly.
+ run: git fetch --prune --unshallow
+
+ - name: Run GoReleaser
+ uses: docker://goreleaser/goreleaser:latest
+ with:
+ args: release --rm-dist
+ env:
+ GITHUB_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }}