Skip to content

Commit c75fa66

Browse files
committed
feat: semantic release
1 parent f0ce9aa commit c75fa66

File tree

5 files changed

+104
-88
lines changed

5 files changed

+104
-88
lines changed

.github/workflows/backend.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Backend
23

34
on:

.github/workflows/charts.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Charts
23

34
on:

.github/workflows/frontend.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Frontend
23
on:
34
push:

.github/workflows/publish.yaml

-88
This file was deleted.

.github/workflows/release.yaml

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
name: Release
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
workflow_call:
9+
secrets:
10+
ADFINISBOT_PAT:
11+
required: true
12+
13+
jobs:
14+
semrel:
15+
name: Semantic Release
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout Repository
19+
uses: actions/checkout@v4
20+
with:
21+
token: ${{ secrets.ADFINISBOT_PAT }}
22+
23+
- name: Semantic Release
24+
uses: go-semantic-release/action@v1
25+
id: semrel
26+
with:
27+
github-token: ${{ secrets.ADFINISBOT_PAT }}
28+
allow-initial-development-versions: true
29+
30+
- run: pipx install poetry
31+
if: steps.semrel.outputs.version != ''
32+
33+
- name: Adjust Versions
34+
if: steps.semrel.outputs.version != ''
35+
run: |
36+
cd api && poetry version ${{ steps.semrel.outputs.version }} && cd -
37+
cd ember && yarn version --no-commit-hooks --no-git-tag-version --new-version ${{ steps.semrel.outputs.version }}
38+
39+
- name: Adjust Versions in Chart.yaml
40+
if: steps.semrel.outputs.version != ''
41+
uses: mikefarah/[email protected]
42+
with:
43+
cmd: yq eval '(.appVersion = "${{ steps.semrel.outputs.version }}") | (.version = "{{ steps.semrel.outputs.version }}" )' --inplace ./charts/outdated/Chart.yaml
44+
45+
- name: Release Commit
46+
if: steps.semrel.outputs.version != ''
47+
run: |
48+
git config user.name "Semantic Release"
49+
git config user.email "[email protected]"
50+
git add ember/package.json api/pyproject.toml charts/outdated/Chart.yaml
51+
git commit -m "chore(release): ${{ steps.semrel.outputs.version }} [skip ci]"
52+
git push
53+
54+
- name: Login to GitHub Container Registry
55+
uses: docker/login-action@v3
56+
if: steps.semrel.outputs.version != ''
57+
with:
58+
registry: ghcr.io
59+
username: ${{ github.actor }}
60+
password: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: Set up Docker Buildx
63+
if: steps.semrel.outputs.version != ''
64+
uses: docker/setup-buildx-action@v3
65+
66+
- name: Build and Push API Docker Image
67+
if: steps.semrel.outputs.version != ''
68+
uses: docker/build-push-action@v5
69+
with:
70+
context: ./api/
71+
push: true
72+
tags: |
73+
ghcr.io/${{ github.repository }}/api:${{ steps.semrel.outputs.version }}
74+
ghcr.io/${{ github.repository }}/api:latest
75+
76+
- name: Build and Push Ember Docker Image
77+
if: steps.semrel.outputs.version != ''
78+
uses: docker/build-push-action@v5
79+
with:
80+
context: ./ember/
81+
push: true
82+
tags: |
83+
ghcr.io/${{ github.repository }}/ember:${{ steps.semrel.outputs.version }}
84+
ghcr.io/${{ github.repository }}/ember:latest
85+
86+
- name: Set up Helm
87+
if: steps.semrel.outputs.version != ''
88+
uses: azure/[email protected]
89+
with:
90+
version: v3.14.0
91+
92+
- name: Package Chart
93+
if: steps.semrel.outputs.version != ''
94+
run: |
95+
helm repo add bitnami https://charts.bitnami.com/bitnami
96+
helm dependency build charts/outdated
97+
helm package --destination=dist charts/outdated
98+
99+
- name: Push Chart
100+
if: steps.semrel.outputs.version != ''
101+
run: helm push dist/*.tgz oci://ghcr.io/${{ github.repository }}/helm

0 commit comments

Comments
 (0)