Skip to content

Commit

Permalink
feat: add release and build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kha7iq committed Jul 6, 2021
1 parent 12e47ec commit c211546
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build.yml
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
14 changes: 14 additions & 0 deletions .github/workflows/pull_request.yml
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

0 comments on commit c211546

Please sign in to comment.