Skip to content

Commit 5b5a473

Browse files
committed
ci: automation of releases
1 parent 28c7091 commit 5b5a473

File tree

5 files changed

+70
-11
lines changed

5 files changed

+70
-11
lines changed

.github/release-drafter.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
template: |
2+
# What's Changed
3+
$CHANGES
4+
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION
5+
name-template: "Version $RESOLVED_VERSION"
6+
tag-template: "$RESOLVED_VERSION"
7+
8+
version-resolver:
9+
major:
10+
labels:
11+
- "release-major"
12+
minor:
13+
labels:
14+
- "release-minor"
15+
patch:
16+
labels:
17+
- "release-patch"
18+
default: patch
19+
20+
autolabeler:
21+
- label: "release-major"
22+
title:
23+
- "/^BREAKING CHANGE:/"
24+
- label: "release-minor"
25+
title:
26+
- "/^feat:/"
27+
- "/^feat\\(.+\\):/"

.github/workflows/__shared-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77

88
golangci-lint:
9-
runs-on: ubuntu-latest
9+
runs-on: self-hosted
1010
steps:
1111
- name: Checkout code
1212
uses: actions/checkout@v4
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
matrix:
2525
go-version: ['1.21']
26-
platform: [ubuntu-latest]
26+
platform: [self-hosted]
2727
runs-on: ${{ matrix.platform }}
2828
steps:
2929
- name: Checkout code
@@ -37,7 +37,7 @@ jobs:
3737
run: go test ./... -v -covermode=count
3838

3939
go-coverage:
40-
runs-on: ubuntu-latest
40+
runs-on: self-hosted
4141
steps:
4242
- name: Checkout code
4343
uses: actions/checkout@v4
@@ -61,7 +61,7 @@ jobs:
6161
allow-empty: true
6262

6363
ct-lint:
64-
runs-on: ubuntu-latest
64+
runs-on: self-hosted
6565
steps:
6666

6767
- name: Checkout

.github/workflows/main-ci.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,27 @@ name: Main - Continuous Integration
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
610

711
jobs:
12+
13+
update_release_draft:
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
runs-on: self-hosted
18+
steps:
19+
- uses: release-drafter/release-drafter@v6
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
with:
23+
publish: true
24+
disable-autolabeler: true
25+
826
ci:
927
name: Continuous Integration
10-
uses: ./.github/workflows/__shared-ci.yml
28+
uses: ./.github/workflows/__shared-ci.yml

.github/workflows/pull-request-ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ on:
55
branches: [main]
66

77
jobs:
8+
9+
pull-request-labeler:
10+
runs-on: self-hosted
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
15+
steps:
16+
- uses: release-drafter/release-drafter@v6
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
with:
20+
disable-releaser: true
21+
822
ci:
923
name: Continuous Integration
10-
uses: ./.github/workflows/__shared-ci.yml
24+
uses: ./.github/workflows/__shared-ci.yml

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
check-branches:
1212
name: Check branches
13-
runs-on: ubuntu-latest
13+
runs-on: self-hosted
1414
steps:
1515
- name: Check branch
1616
run: |
@@ -27,7 +27,7 @@ jobs:
2727
skaffold-build:
2828
name: 👷‍♂️ Run skaffold build
2929
needs: ci
30-
runs-on: ubuntu-latest
30+
runs-on: self-hosted
3131
steps:
3232
# Login to docker hub
3333
- name: 🔒 Login to hub
@@ -67,7 +67,7 @@ jobs:
6767
helm-push:
6868
name: 👷‍♂️ Run helm push
6969
needs: ci
70-
runs-on: ubuntu-latest
70+
runs-on: self-hosted
7171
steps:
7272
# Get a local copy of the code
7373
- uses: actions/checkout@v4
@@ -107,7 +107,7 @@ jobs:
107107
needs:
108108
- skaffold-build
109109
- helm-push
110-
runs-on: ubuntu-latest
110+
runs-on: self-hosted
111111
steps:
112112
- uses: tibdex/github-app-token@v2
113113
id: generate-token

0 commit comments

Comments
 (0)