diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..30afc4a --- /dev/null +++ b/.github/workflows/build.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..ccaa462 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -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 \ No newline at end of file