-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add release and build workflow
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
release-subvars: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2.3.4 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.16' | ||
- | ||
name: Cache Go modules | ||
uses: actions/cache@v2.1.5 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- | ||
name: Diff | ||
run: git diff | ||
|
||
|
||
- | ||
name: Release SubVars | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
|
||
- | ||
name: Notify on failure | ||
uses: kha7iq/pingme-action@v1 | ||
if: failure() | ||
env: | ||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | ||
TELEGRAM_CHANNELS: ${{ secrets.TELEGRAM_CHANNELS }} | ||
TELEGRAM_TITLE: '🟢 New Release: ${{ github.ref }}' | ||
TELEGRAM_MESSAGE: 'Event is triggerd by ${{ github.event_name }} ❌ ${{ job.status }}' | ||
with: | ||
service: telegram | ||
|
||
- | ||
name: Notify on success | ||
uses: kha7iq/pingme-action@v1 | ||
if: success() | ||
env: | ||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | ||
TELEGRAM_CHANNELS: ${{ secrets.TELEGRAM_CHANNELS }} | ||
TELEGRAM_TITLE: '🟢 New Release: ${{ github.ref }}' | ||
TELEGRAM_MESSAGE: 'Event is triggerd by ${{ github.event_name }} ✅ ${{ job.status }}' | ||
with: | ||
service: telegram |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
on: pull_request | ||
|
||
jobs: | ||
lint-code: | ||
runs-on: ubuntu-latest | ||
name: Perform Checks | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.29 |