mirror of
https://github.com/MedzikUser/go-pingbot
synced 2024-08-14 23:57:07 +00:00
46 lines
960 B
YAML
46 lines
960 B
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
releaser:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.17
|
|
|
|
- name: Semantic Release
|
|
if: github.event_name != 'pull_request'
|
|
uses: go-semantic-release/action@v1
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Remove Local Changes
|
|
run: git stash -u
|
|
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v2
|
|
with:
|
|
distribution: goreleaser
|
|
version: latest
|
|
args: release --rm-dist
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
path: dist
|