Skip to content

Commit

Permalink
ci: automation of releases
Browse files Browse the repository at this point in the history
  • Loading branch information
fredleger committed Feb 20, 2024
1 parent 28c7091 commit 5b5a473
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 11 deletions.
27 changes: 27 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
template: |
# What's Changed
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION
name-template: "Version $RESOLVED_VERSION"
tag-template: "$RESOLVED_VERSION"

version-resolver:
major:
labels:
- "release-major"
minor:
labels:
- "release-minor"
patch:
labels:
- "release-patch"
default: patch

autolabeler:
- label: "release-major"
title:
- "/^BREAKING CHANGE:/"
- label: "release-minor"
title:
- "/^feat:/"
- "/^feat\\(.+\\):/"
8 changes: 4 additions & 4 deletions .github/workflows/__shared-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:

golangci-lint:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -23,7 +23,7 @@ jobs:
strategy:
matrix:
go-version: ['1.21']
platform: [ubuntu-latest]
platform: [self-hosted]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
Expand All @@ -37,7 +37,7 @@ jobs:
run: go test ./... -v -covermode=count

go-coverage:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -61,7 +61,7 @@ jobs:
allow-empty: true

ct-lint:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:

- name: Checkout
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,27 @@ name: Main - Continuous Integration

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

permissions:
contents: read

jobs:

update_release_draft:
permissions:
contents: write
pull-requests: write
runs-on: self-hosted
steps:
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
publish: true
disable-autolabeler: true

ci:
name: Continuous Integration
uses: ./.github/workflows/__shared-ci.yml
uses: ./.github/workflows/__shared-ci.yml
16 changes: 15 additions & 1 deletion .github/workflows/pull-request-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ on:
branches: [main]

jobs:

pull-request-labeler:
runs-on: self-hosted
permissions:
contents: write
pull-requests: write

steps:
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
disable-releaser: true

ci:
name: Continuous Integration
uses: ./.github/workflows/__shared-ci.yml
uses: ./.github/workflows/__shared-ci.yml
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
check-branches:
name: Check branches
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Check branch
run: |
Expand All @@ -27,7 +27,7 @@ jobs:
skaffold-build:
name: 👷‍♂️ Run skaffold build
needs: ci
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
# Login to docker hub
- name: 🔒 Login to hub
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
helm-push:
name: 👷‍♂️ Run helm push
needs: ci
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
# Get a local copy of the code
- uses: actions/checkout@v4
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
needs:
- skaffold-build
- helm-push
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- uses: tibdex/github-app-token@v2
id: generate-token
Expand Down

0 comments on commit 5b5a473

Please sign in to comment.