This commit is contained in:
Medzik 2021-08-18 16:38:49 +00:00
parent 6faee132ad
commit cafc70c6a6
4 changed files with 18 additions and 39 deletions

View File

@ -1,6 +1,7 @@
name: Push name: go mod tidy
on: [push] on:
push:
jobs: jobs:
mod-tidy: mod-tidy:
@ -17,13 +18,13 @@ jobs:
with: with:
go-version: 1.17 go-version: 1.17
- name: Tidy - name: Mod Tidy
run: go mod tidy run: go mod tidy
- name: Commit - name: Commit
run: | run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]" git config --local user.name "github-actions[bot]"
git add -A git add .
git diff-index --quiet HEAD || git commit -m "go mod tidy" git diff-index --quiet HEAD || git commit -m "go mod tidy"
- name: Push changes - name: Push changes

View File

@ -1,6 +1,8 @@
name: Lint name: go lint
on: [pull_request, push] on:
pull_request:
push:
jobs: jobs:
golangci: golangci:

View File

@ -1,29 +0,0 @@
name: Pull Request
on: [pull_request]
jobs:
pull:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- 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

View File

@ -3,6 +3,7 @@ name: Release
on: on:
push: push:
branches: [ main ] branches: [ main ]
pull_request:
permissions: permissions:
contents: write contents: write
@ -22,14 +23,13 @@ jobs:
go-version: 1.17 go-version: 1.17
- name: Semantic Release - name: Semantic Release
if: github.event_name != 'pull_request'
uses: go-semantic-release/action@v1 uses: go-semantic-release/action@v1
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout - name: Remove Local Changes
uses: actions/checkout@v2 run: git stash -u
with:
fetch-depth: '0'
- name: Run GoReleaser - name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2 uses: goreleaser/goreleaser-action@v2
@ -39,3 +39,8 @@ jobs:
args: release --rm-dist args: release --rm-dist
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
path: dist