2020-03-11 00:54:39 +00:00
|
|
|
name: Release
|
2020-11-20 13:24:53 +00:00
|
|
|
on: [workflow_dispatch]
|
2020-03-11 00:36:41 +00:00
|
|
|
jobs:
|
2020-11-20 13:24:53 +00:00
|
|
|
tag:
|
|
|
|
name: Tag
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Setup Node.js for use with actions
|
2021-07-28 02:00:23 +00:00
|
|
|
uses: actions/setup-node@v2.3.0
|
2020-11-20 13:24:53 +00:00
|
|
|
|
|
|
|
- name: Checkout
|
2021-05-12 10:15:52 +00:00
|
|
|
uses: actions/checkout@v2.3.4
|
2020-11-20 13:24:53 +00:00
|
|
|
|
|
|
|
- name: Unshallow
|
|
|
|
run: git fetch --prune --unshallow
|
|
|
|
|
|
|
|
- name: Install semantic-release
|
|
|
|
run: yarn global add --no-progress --non-interactive "semantic-release" "@semantic-release/exec"
|
|
|
|
|
|
|
|
- name: Run semantic-release
|
|
|
|
run: $(yarn global bin)/semantic-release
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-03-11 00:36:41 +00:00
|
|
|
|
|
|
|
release:
|
|
|
|
runs-on: ubuntu-latest
|
2020-03-11 00:52:29 +00:00
|
|
|
# if: startsWith(github.ref, 'refs/tags/')
|
2020-11-20 13:24:53 +00:00
|
|
|
needs: [tag]
|
2020-03-11 00:36:41 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2021-05-12 10:15:52 +00:00
|
|
|
uses: actions/checkout@v2.3.4
|
2020-03-11 00:36:41 +00:00
|
|
|
|
|
|
|
- name: Unshallow
|
|
|
|
run: git fetch --prune --unshallow
|
|
|
|
|
|
|
|
- name: Set up Go
|
2020-11-02 12:19:37 +00:00
|
|
|
uses: actions/setup-go@v2.1.3
|
2020-03-11 00:36:41 +00:00
|
|
|
with:
|
2020-11-22 00:15:40 +00:00
|
|
|
go-version: ^1.15.0
|
2020-03-11 00:36:41 +00:00
|
|
|
id: go
|
|
|
|
|
2020-11-02 13:40:49 +00:00
|
|
|
- name: Login to DockerHub
|
2021-05-12 10:16:03 +00:00
|
|
|
uses: docker/login-action@v1.9.0
|
2020-11-02 13:40:49 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
|
|
password: ${{ secrets.DOCKER_PASS }}
|
2020-04-09 13:56:04 +00:00
|
|
|
|
2020-03-11 00:36:41 +00:00
|
|
|
- name: Run GoReleaser
|
2021-05-28 06:19:59 +00:00
|
|
|
uses: goreleaser/goreleaser-action@v2.6.0
|
2020-03-11 00:36:41 +00:00
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args: release --rm-dist
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|