Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: release please setup to automate releases #308

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/_commit_lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: commit-lint

on:
workflow_call:

jobs:
lint:
runs-on: ubuntu-latest

iamvigneshwars marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Checkout Code
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Lint Commits
uses: wagoid/[email protected]
with:
failonWarnings: true
4 changes: 2 additions & 2 deletions .github/workflows/_dashboard_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
with:
context: ./frontend
target: nginx
push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
load: ${{ !(github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) }}
push: ${{ github.event_name == 'release' && startsWith(github.event.release.tag_name, 'dashboard@') }}
load: ${{ !(github.event_name == 'release' && startsWith(github.event.release.tag_name, 'dashboard@')) }}
iamvigneshwars marked this conversation as resolved.
Show resolved Hide resolved
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/_graph_proxy_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:
context: backend
file: backend/Dockerfile.graph-proxy
target: deploy
push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
load: ${{ !(github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) }}
push: ${{ github.event_name == 'release' && startsWith(github.event.release.tag_name, 'graph-proxy@') }}
load: ${{ !(github.event_name == 'release' && startsWith(github.event.release.tag_name, 'graph-proxy@')) }}
iamvigneshwars marked this conversation as resolved.
Show resolved Hide resolved
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/_helm_lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ jobs:
lint
--target-branch=${{ github.event.repository.default_branch }}
--validate-maintainers=false
--check-version-increment=false
41 changes: 41 additions & 0 deletions .github/workflows/_release_please.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release Please

on:
workflow_call:
secrets:
release_please_token:
required: true

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Create GitHub App Token
id: app-token
uses: actions/[email protected]
with:
app-id: 1077859
private-key: ${{ secrets.release_please_token }}

- uses: googleapis/release-please-action@v4
with:
token: ${{ steps.app-token.outputs.token }}
manifest-file: .release-please-manifest.json
config-file: release-please-config.json

- name: Release Outputs
run: |
echo "Paths Released: ${{ steps.release.outputs.paths_released }}"
echo "Apps Chart Released: ${{ contains(steps.release.outputs.paths_released, 'charts/apps') }}"
echo "Argocd Chart Released: ${{ contains(steps.release.outputs.paths_released, 'charts/argocd') }}"
echo "Dashboard Chart Released: ${{ contains(steps.release.outputs.paths_released, 'charts/dashboard') }}"
echo "Events Chart Released: ${{ contains(steps.release.outputs.paths_released, 'charts/events') }}"
echo "Graph Proxy Chart Released: ${{ contains(steps.release.outputs.paths_released, 'charts/graph-proxy') }}"
echo "Groups Chart Released: ${{ contains(steps.release.outputs.paths_released, 'charts/groups') }}"
echo "Sessionspaces Chart Released: ${{ contains(steps.release.outputs.paths_released, 'charts/sessionspaces') }}"
echo "Docs Released: ${{ contains(steps.release.outputs.paths_released, 'docs') }}"
echo "Dashboard node package Released: ${{ contains(steps.release.outputs.paths_released, 'frontend/dashboard') }}"
echo "Relay workflows library node package Released: ${{ contains(steps.release.outputs.paths_released, 'frontend/relay-workflows-lib') }}"
echo "Workflows Library node package Released: ${{ contains(steps.release.outputs.paths_released, 'frontend/workflows-lib') }}"
echo "Graph Proxy Released: ${{ contains(steps.release.outputs.paths_released, 'graph-proxy') }}"
echo "Sessionspaces Released: ${{ contains(steps.release.outputs.paths_released, 'sessionspaces') }}"
4 changes: 2 additions & 2 deletions .github/workflows/_sessionspaces_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ jobs:
context: backend
file: backend/Dockerfile.sessionspaces
target: deploy
push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
load: ${{ !(github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) }}
push: ${{ github.event_name == 'release' && startsWith(github.event.release.tag_name, 'sessionspaces@') }}
load: ${{ !(github.event_name == 'release' && startsWith(github.event.release.tag_name, 'sessionspaces@')) }}
iamvigneshwars marked this conversation as resolved.
Show resolved Hide resolved
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,19 @@ jobs:
permissions:
pages: write
id-token: write

commit_lint:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
uses: ./.github/workflows/_commit_lint.yaml
permissions:
contents: read
pull-requests: read

release_please:
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main')
uses: ./.github/workflows/_release_please.yaml
secrets:
release_please_token: ${{ secrets.RELEASE_PLEASE_CLIENT_SECRET }}
permissions:
contents: write
pull-requests: write
20 changes: 20 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"backend/graph-proxy": "0.2.0",
"backend/sessionspaces": "0.1.0",
"charts/apps": "0.4.0",
"charts/argocd": "0.2.0",
"charts/dashboard": "0.1.2",
"charts/events": "0.1.2",
"charts/graph-proxy": "0.2.3",
"charts/groups": "0.3.0",
"charts/sessionspaces": "0.3.4",
"charts/verflixt": "0.1.0",
"charts/workflows": "0.12.2",
"charts/workflows-cluster": "0.8.6",
"docs/explanations": "0.1.0",
"docs/how-tos": "0.1.0",
"docs/tutorials": "0.1.0",
"frontend/dashboard": "0.1.0",
"frontend/relay-workflow-lib": "0.1.0",
"frontend/workflows-lib": "0.1.0"
}
61 changes: 61 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"include-component-in-tag": true,
"include-v-in-tag": true,
"tag-separator": "@",
"separate-pull-requests": true,
"extra-files": [
"README.md",
"mkdocs.yml"
],
"packages": {
"backend/graph-proxy": {
"release-type": "rust"
},
"backend/sessionspaces": {
"release-type": "rust"
},
"charts/apps": {
"release-type": "helm"
},
"charts/argocd": {
"release-type": "helm"
},
"charts/dashboard": {
"release-type": "helm"
},
"charts/events": {
"release-type": "helm"
},
"charts/graph-proxy": {
"release-type": "helm"
},
"charts/groups": {
"release-type": "helm"
},
"charts/sessionspaces": {
"release-type": "helm"
},
"charts/verflixt": {
"release-type": "helm"
},
"charts/workflows": {
"release-type": "helm"
},
"charts/workflows-cluster": {
"release-type": "helm"
},
"docs": {
"release-type": "simple"
},
"frontend/dashboard": {
"release-type": "node"
},
"frontend/relay-workflows-lib": {
"release-type": "node"
},
"frontend/workflows-lib": {
"release-type": "node"
}
}
}