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
|
2022-03-30 11:04:49 +00:00
|
|
|
uses: actions/setup-node@v3
|
2020-11-20 13:24:53 +00:00
|
|
|
|
|
|
|
- name: Checkout
|
2022-03-30 11:03:28 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-03-30 11:27:49 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
ref: "refs/pull/${{ github.event.number }}/merge"
|
2020-11-20 13:24:53 +00:00
|
|
|
|
|
|
|
- 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
|
2022-03-30 11:03:28 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-03-30 11:27:49 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
ref: "refs/pull/${{ github.event.number }}/merge"
|
2020-03-11 00:36:41 +00:00
|
|
|
|
|
|
|
- name: Set up Go
|
2021-08-27 01:08:14 +00:00
|
|
|
uses: actions/setup-go@v2.1.4
|
2020-03-11 00:36:41 +00:00
|
|
|
with:
|
2022-02-08 21:56:44 +00:00
|
|
|
go-version: 1.17
|
2020-03-11 00:36:41 +00:00
|
|
|
id: go
|
|
|
|
|
2020-11-02 13:40:49 +00:00
|
|
|
- name: Login to DockerHub
|
2022-02-08 22:59:22 +00:00
|
|
|
uses: docker/login-action@v1.12.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
|
2022-03-30 10:52:59 +00:00
|
|
|
uses: goreleaser/goreleaser-action@v2.9.1
|
2020-03-11 00:36:41 +00:00
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args: release --rm-dist
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|