Skip to content

Commit

Permalink
Merge pull request #80 from bitcoin-sv/ci/use-reusable-workflows
Browse files Browse the repository at this point in the history
ci(SPV-913): use on-push and release reusable workflows
  • Loading branch information
dorzepowski committed Jul 4, 2024
2 parents 1f274f4 + f4fe861 commit 302e8a1
Show file tree
Hide file tree
Showing 11 changed files with 248 additions and 530 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/autotag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ permissions:

on:
push:
branches: [ master,main ]
branches:
- main
- master

jobs:
tag-version:
Expand All @@ -13,8 +15,8 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Because of some github action optimisation [discussed here](https://github.com/orgs/community/discussions/27028)
# We're using Deploy key
# Because of some github action optimisation [discussed here](https://github.com/orgs/community/discussions/27028)
# We're using Deploy key
ssh-key: "${{ secrets.DEPLOYMENT_KEY }}"

- name: Create version tag
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '0 23 * * 0'

Expand Down Expand Up @@ -43,16 +38,5 @@ jobs:
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# ✏️ If the Autobuild fails above, remove it and uncomment the following
# three lines and modify them (or add more) to build your code if your
# project uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
156 changes: 0 additions & 156 deletions .github/workflows/go.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "On push changes"

on:
push:
branches-ignore:
- main
- master

permissions:
contents: write
pull-requests: read

jobs:
on-push:
uses: bactions/workflows/.github/workflows/on-push-go.yml@main
secrets:
DEPLOY_KEY: ${{ secrets.DEPLOYMENT_KEY }}
SLACK_WEBHOOK_URL: ${{ secrets.ON_PUSH_SLACK_WEBHOOK_URL }}
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release
permissions:
contents: write
packages: write

on:
push:
tags:
- 'v*'

jobs:
release:
uses: bactions/workflows/.github/workflows/release-go-server.yml@main
with:
version: ${{ github.ref_name }}
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.ON_RELEASE_SLACK_WEBHOOK_URL }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
4 changes: 2 additions & 2 deletions .golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ linters:
- gosimple
- staticcheck
- unused
#TODO: add revive like in other projects
# TODO: add revive like in other projects

linters-settings:
#TODO: setup like in other projects
# TODO: setup like in other projects
govet:
enable-all: true
disable:
Expand Down
Loading

0 comments on commit 302e8a1

Please sign in to comment.