go-pingbot/.github/workflows/release.yml

49 lines
997 B
YAML
Raw Normal View History

2021-08-18 16:50:08 +00:00
name: release
2021-07-14 09:52:50 +00:00
on:
push:
branches: [ main ]
2021-08-18 16:38:49 +00:00
pull_request:
2021-07-14 09:52:50 +00:00
permissions:
contents: write
jobs:
releaser:
2021-07-14 09:52:50 +00:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
2021-08-01 17:43:59 +00:00
with:
2021-08-17 21:03:04 +00:00
fetch-depth: 0
2021-07-14 09:52:50 +00:00
- name: Set up Go
uses: actions/setup-go@v2
with:
2021-08-17 21:03:04 +00:00
go-version: 1.17
2021-08-07 20:13:41 +00:00
- name: Semantic Release
2021-08-18 16:38:49 +00:00
if: github.event_name != 'pull_request'
2021-08-07 20:13:41 +00:00
uses: go-semantic-release/action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2021-08-18 17:11:40 +00:00
- name: Checkout
uses: actions/checkout@v2
2021-08-18 17:19:07 +00:00
with:
fetch-depth: '0'
2021-07-14 09:52:50 +00:00
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2021-08-18 16:38:49 +00:00
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
path: dist