Skip to content

Commit

Permalink
feat(BUX-000): unifies github actions workflow (#7)
Browse files Browse the repository at this point in the history
* feat: unifies workflow

* feat(BUX-000): fix brfc tests

* feat: adds Deggen's brfc to test cases

* feat: updates to a newest version of bump-version

* feat: removes syndicate from taskfile

---------

Co-authored-by: arkadiuszos4chain <[email protected]>
  • Loading branch information
wregulski and arkadiuszos4chain authored Sep 8, 2023
1 parent 3d6b2d8 commit b53b3a0
Show file tree
Hide file tree
Showing 21 changed files with 147 additions and 1,053 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
64 changes: 64 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
pull_request_rules:

# ===============================================================================
# DEPENDABOT
# ===============================================================================

- name: Automatic Merge for Dependabot Minor Version Pull Requests
conditions:
- -draft
- check-success='test-and-lint'
- author~=^dependabot(|-preview)\[bot\]$
- title~=bump [^\s]+ from ([\d]+)\..+ to \1\.
actions:
review:
type: APPROVE
message: Automatically approving dependabot pull request
merge:
method: merge
- name: Alert on major version detection
conditions:
- author~=^dependabot(|-preview)\[bot\]$
- -title~=bump [^\s]+ from ([\d]+)\..+ to \1\.
actions:
comment:
message: "⚠️ This is a major version bump and requires attention"


# ===============================================================================
# AUTHOR
# ===============================================================================

- name: Auto-Assign Author
conditions:
- "#assignee=0"
actions:
assign:
users: ["{{author}}"]


# ===============================================================================
# STALE BRANCHES
# ===============================================================================

- name: Close stale pull request
conditions:
- base=master
- -closed
- updated-at<21 days ago
actions:
close:
message: |
This pull request looks stale. Feel free to reopen it if you think it's a mistake.
label:
add: ["stale"]

# ===============================================================================
# BRANCHES
# ===============================================================================

- name: Delete head branch after merge
conditions:
- merged
actions:
delete_head_branch:
42 changes: 42 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: bump-version

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: release-please
id: release
uses: GoogleCloudPlatform/release-please-action@v3
with:
token: ${{ secrets.TOKEN }}
release-type: go
- name: Get created PR number
id: pr-number
if: steps.release.outputs.pr
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const pr = ${{ steps.release.outputs.pr }};
return pr && pr.number
- name: Approve Release PR
if: steps.release.outputs.pr
run: gh pr review ${{ steps.pr-number.outputs.result }} --approve
env:
GH_TOKEN: ${{ github.token }}
- name: Merge Release PR
if: steps.release.outputs.pr
run: gh pr merge ${{ steps.pr-number.outputs.result }} --auto --rebase
env:
GH_TOKEN: ${{ secrets.TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: release

on:
push:
tags:
- '*'

jobs:
syndicate:
runs-on: ubuntu-latest
steps:
- name: Install cURL
run: sudo apt-get install curl -y
- name: Syndicate to GoDocs
run: |
echo "syndicating to GoDocs..."
curl "https://proxy.golang.org/github.com/${{ github.repository }}/v/${{ github.ref }}/info"
File renamed without changes.
Loading

0 comments on commit b53b3a0

Please sign in to comment.