Skip to content

Commit df4a4b7

Browse files
committed
init
0 parents  commit df4a4b7

File tree

175 files changed

+19926
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+19926
-0
lines changed
41.3 KB
Loading

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/dependabot.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm"
9+
directories:
10+
- "/"
11+
schedule:
12+
interval: "weekly"
13+
commit-message:
14+
prefix: "chore(all)"
15+
open-pull-requests-limit: 20
16+
17+
- package-ecosystem: "npm"
18+
directories:
19+
- "services/frontend"
20+
schedule:
21+
interval: "weekly"
22+
commit-message:
23+
prefix: "chore(frontend)"
24+
open-pull-requests-limit: 20
25+
26+
- package-ecosystem: "npm"
27+
directories:
28+
- "services/backend"
29+
schedule:
30+
interval: "weekly"
31+
commit-message:
32+
prefix: "chore(backend)"
33+
open-pull-requests-limit: 20
34+
35+
- package-ecosystem: 'github-actions'
36+
directory: '/'
37+
schedule:
38+
interval: 'weekly'
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Backend Release PR
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
type:
6+
type: choice
7+
description: Choose release type
8+
options:
9+
- auto
10+
- patch
11+
- minor
12+
- major
13+
default: auto
14+
beta:
15+
type: boolean
16+
description: Prerelease
17+
default: false
18+
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
23+
jobs:
24+
releaseIt:
25+
runs-on: ubuntu-latest
26+
defaults:
27+
run:
28+
working-directory: services/backend
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
- name: git config
34+
run: |
35+
git config user.name "${GITHUB_ACTOR}"
36+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
37+
- name: Setup node
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: 20
41+
cache: npm
42+
- run: npm ci
43+
- name: Prepare release
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
TYPE_ARG: ${{ fromJSON('{"auto":"", "patch":"patch", "minor":"minor", "major":"major"}')[github.event.inputs.type] }}
47+
BETA_ARG: ${{ github.event.inputs.beta == 'true' && '--preRelease=beta' || '' }}
48+
run: npm run release -- $TYPE_ARG --ci --verbose --no-git.push --no-git.commit --no-git.tag --no-github $BETA_ARG
49+
- name: get-npm-version
50+
id: package-version
51+
uses: martinbeentjes/npm-get-version-action@main
52+
with:
53+
path: services/backend
54+
- name: Extract release notes
55+
id: extract-release-notes
56+
uses: ffurrer2/extract-release-notes@v2
57+
with:
58+
changelog_file: services/backend/CHANGELOG.md
59+
- name: Create pull request
60+
uses: peter-evans/create-pull-request@v7
61+
id: cpr
62+
with:
63+
branch: backend-release
64+
delete-branch: true
65+
commit-message: 'chore(backend): release v${{ steps.package-version.outputs.current-version}}'
66+
title: '[Backend Release] v${{ steps.package-version.outputs.current-version}}'
67+
body: |
68+
## Backend Release v${{ steps.package-version.outputs.current-version}}
69+
70+
This PR prepares a new backend release.
71+
72+
When merged, this will:
73+
1. Create a release tag
74+
2. Build and publish a multi-architecture Docker image to Docker Hub
75+
76+
The Docker image will be available at:
77+
- `deploystack/backend:latest`
78+
- `deploystack/backend:v${{ steps.package-version.outputs.current-version}}`
79+
80+
### Supported Architectures
81+
- `linux/amd64` (Intel/AMD)
82+
- `linux/arm64` (Apple Silicon, AWS Graviton)
83+
84+
### Environment Variables
85+
The Docker image will include `DEPLOYSTACK_BACKEND_VERSION` environment variable set to the current version.
86+
87+
## Release notes:
88+
${{ steps.extract-release-notes.outputs.release_notes }}
89+
labels: |
90+
backend
91+
release
92+
automated pr
93+
draft: false
94+
- name: Show PR link
95+
if: ${{ steps.cpr.outputs.pull-request-url }}
96+
run: |
97+
echo "Backend Release v${{ steps.package-version.outputs.current-version}}' pull request - ${{ steps.cpr.outputs.pull-request-url }}"
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Fix for .github/workflows/backend-release.yml
2+
name: Backend Release
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- main
8+
paths:
9+
- 'services/backend/**'
10+
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
15+
jobs:
16+
release:
17+
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'backend') && contains(github.event.pull_request.labels.*.name, 'release')
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: git config
25+
run: |
26+
git config user.name "${GITHUB_ACTOR}"
27+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
28+
29+
- name: Setup node
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 20
33+
cache: npm
34+
35+
# Install dependencies at root level for workspaces
36+
- name: Install dependencies
37+
run: npm ci
38+
39+
# Now run release-it with the --no-git.requireCleanWorkingDir flag
40+
- name: Prepare release
41+
working-directory: services/backend
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
run: npm run release -- --ci --verbose --no-git.requireCleanWorkingDir
45+
46+
# Get the version after release-it has run
47+
- name: Get version
48+
id: package-version
49+
uses: martinbeentjes/npm-get-version-action@main
50+
with:
51+
path: services/backend
52+
53+
# Build the backend
54+
- name: Build backend
55+
working-directory: services/backend
56+
run: |
57+
npm run build
58+
59+
# Prepare shared resources directory for Docker
60+
- name: Prepare shared directories
61+
run: |
62+
mkdir -p /tmp/shared
63+
cp -r services/shared/* /tmp/shared/
64+
65+
- name: Set up QEMU
66+
uses: docker/setup-qemu-action@v3
67+
68+
- name: Set up Docker Buildx
69+
uses: docker/setup-buildx-action@v3
70+
71+
- name: Login to Docker Hub
72+
uses: docker/login-action@v3
73+
with:
74+
username: ${{ secrets.DOCKERHUB_USERNAME }}
75+
password: ${{ secrets.DOCKERHUB_TOKEN }}
76+
77+
- name: Build and push Docker image
78+
uses: docker/build-push-action@v6
79+
with:
80+
context: .
81+
file: ./services/backend/Dockerfile
82+
platforms: linux/amd64,linux/arm64
83+
push: true
84+
tags: |
85+
deploystack/backend:latest
86+
deploystack/backend:v${{ steps.package-version.outputs.current-version }}
87+
build-args: |
88+
DEPLOYSTACK_BACKEND_VERSION=${{ steps.package-version.outputs.current-version }}
89+
cache-from: type=gha
90+
cache-to: type=gha,mode=max
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: Frontend Release PR
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
type:
6+
type: choice
7+
description: Choose release type
8+
options:
9+
- auto
10+
- patch
11+
- minor
12+
- major
13+
default: auto
14+
beta:
15+
type: boolean
16+
description: Prerelease
17+
default: false
18+
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
23+
jobs:
24+
releaseIt:
25+
runs-on: ubuntu-latest
26+
defaults:
27+
run:
28+
working-directory: services/frontend
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
34+
- name: git config
35+
run: |
36+
git config user.name "${GITHUB_ACTOR}"
37+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
38+
39+
- name: Setup node
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: 20
43+
cache: npm
44+
45+
# Clean install to avoid rollup issues with optional dependencies
46+
- name: Install dependencies with clean slate
47+
run: |
48+
rm -rf node_modules package-lock.json || true
49+
npm install
50+
51+
# Determine the next version based on input
52+
- name: Get current version
53+
id: current-version
54+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
55+
56+
- name: Determine next version
57+
id: next-version
58+
run: |
59+
current=${{ steps.current-version.outputs.version }}
60+
IFS='.' read -r -a version_parts <<< "$current"
61+
major=${version_parts[0]}
62+
minor=${version_parts[1]}
63+
patch=${version_parts[2]}
64+
65+
# Determine type of version bump
66+
case "${{ github.event.inputs.type }}" in
67+
major)
68+
new_major=$((major + 1))
69+
new_version="$new_major.0.0"
70+
;;
71+
minor)
72+
new_minor=$((minor + 1))
73+
new_version="$major.$new_minor.0"
74+
;;
75+
patch)
76+
new_patch=$((patch + 1))
77+
new_version="$major.$minor.$new_patch"
78+
;;
79+
auto|*)
80+
# Default to minor
81+
new_minor=$((minor + 1))
82+
new_version="$major.$new_minor.0"
83+
;;
84+
esac
85+
86+
# Add beta suffix if requested
87+
if [[ "${{ github.event.inputs.beta }}" == "true" ]]; then
88+
new_version="${new_version}-beta.1"
89+
fi
90+
91+
echo "version=$new_version" >> $GITHUB_OUTPUT
92+
93+
# Create a temporary changelog entry
94+
- name: Generate changelog entry
95+
id: changelog
96+
run: |
97+
echo "# ${{ steps.next-version.outputs.version }} ($(date +%Y-%m-%d))" > CHANGELOG_NEW.md
98+
echo "" >> CHANGELOG_NEW.md
99+
echo "### Features" >> CHANGELOG_NEW.md
100+
echo "* Release version ${{ steps.next-version.outputs.version }}" >> CHANGELOG_NEW.md
101+
echo "" >> CHANGELOG_NEW.md
102+
cat CHANGELOG.md >> CHANGELOG_NEW.md 2>/dev/null || true
103+
cat CHANGELOG_NEW.md > TEMP_CHANGELOG.md
104+
105+
# Create a PR with the version changes
106+
- name: Create pull request
107+
uses: peter-evans/create-pull-request@v7
108+
id: cpr
109+
with:
110+
branch: frontend-release
111+
delete-branch: true
112+
commit-message: 'chore(frontend): release v${{ steps.next-version.outputs.version }}'
113+
title: '[Frontend Release] v${{ steps.next-version.outputs.version }}'
114+
body: |
115+
## Frontend Release v${{ steps.next-version.outputs.version }}
116+
117+
This PR prepares a new frontend release.
118+
119+
When merged, this will:
120+
1. Create a release tag
121+
2. Build and publish a multi-architecture Docker image to Docker Hub
122+
123+
The Docker image will be available at:
124+
- `deploystack/frontend:latest`
125+
- `deploystack/frontend:v${{ steps.next-version.outputs.version }}`
126+
127+
### Supported Architectures
128+
- `linux/amd64` (Intel/AMD)
129+
- `linux/arm64` (Apple Silicon, AWS Graviton)
130+
- `linux/arm/v7` (Raspberry Pi, IoT devices)
131+
132+
## Release notes:
133+
See attached changelog updates
134+
labels: |
135+
frontend
136+
release
137+
automated pr
138+
draft: false
139+
add-paths: |
140+
services/frontend/package.json
141+
services/frontend/CHANGELOG.md
142+
143+
- name: Show PR link
144+
if: ${{ steps.cpr.outputs.pull-request-url }}
145+
run: |
146+
echo "Frontend Release v${{ steps.next-version.outputs.version }}' pull request - ${{ steps.cpr.outputs.pull-request-url }}"

0 commit comments

Comments
 (0)