Skip to content

Commit 3d1ae95

Browse files
authored
Merge pull request #2252 from Freika/dev
1.2.0
2 parents e7ab835 + 59c3a45 commit 3d1ae95

File tree

99 files changed

+2533
-1131
lines changed

Some content is hidden

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

99 files changed

+2533
-1131
lines changed

.app_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.0
1+
1.2.0
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,11 @@
66
!/public/exports/.keep
77
/public/imports/*
88
!/public/imports/.keep
9+
10+
.git/
11+
.github/
12+
docs/
13+
.circleci/
14+
.devcontainer/
15+
screenshots/
16+
.ruby-lsp/

.github/workflows/biome.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ jobs:
3535
- name: Run Biome
3636
env:
3737
BASE: ${{ steps.base.outputs.ref }}
38-
run: biome ci . --reporter=github --changed --since="$BASE"
38+
run: biome ci . --reporter=github --changed --since="$BASE" --no-errors-on-unmatched

.github/workflows/build_and_push.yml

Lines changed: 128 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,53 @@ on:
1111
types: [created]
1212

1313
jobs:
14-
build-and-push-docker:
14+
prepare:
1515
runs-on: ubuntu-22.04
16+
outputs:
17+
version: ${{ steps.meta.outputs.version }}
18+
is_prerelease: ${{ steps.meta.outputs.is_prerelease }}
19+
platforms: ${{ steps.meta.outputs.platforms }}
20+
matrix: ${{ steps.meta.outputs.matrix }}
21+
steps:
22+
- name: Compute version and platforms
23+
id: meta
24+
run: |
25+
if [[ $GITHUB_REF == refs/tags/* ]]; then
26+
VERSION=${GITHUB_REF#refs/tags/}
27+
else
28+
VERSION=$GITHUB_REF_NAME
29+
fi
30+
if [ -z "$VERSION" ]; then
31+
VERSION="rc"
32+
fi
33+
34+
IS_PRERELEASE="${{ github.event.release.prerelease }}"
35+
PLATFORMS="linux/amd64,linux/arm64,linux/arm/v7"
36+
MATRIX='{"include":[{"platform":"linux/amd64","runner":"ubuntu-22.04"},{"platform":"linux/arm64","runner":"ubuntu-22.04-arm"},{"platform":"linux/arm/v7","runner":"ubuntu-22.04-arm"}]}'
37+
38+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
39+
echo "is_prerelease=${IS_PRERELEASE}" >> $GITHUB_OUTPUT
40+
echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT
41+
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT
42+
43+
build-and-push-docker:
44+
needs: prepare
45+
strategy:
46+
fail-fast: false
47+
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}
48+
runs-on: ${{ matrix.runner }}
1649
steps:
1750
- name: Checkout code
1851
uses: actions/checkout@v4
1952
with:
2053
ref: ${{ github.event.inputs.branch || github.ref_name }}
2154

55+
# QEMU only needed for arm/v7 (armv7 emulated on aarch64 runner)
2256
- name: Set up QEMU
57+
if: matrix.platform == 'linux/arm/v7'
2358
uses: docker/setup-qemu-action@v3
59+
with:
60+
platforms: linux/arm/v7
2461

2562
- name: Set up Docker Buildx
2663
uses: docker/setup-buildx-action@v3
@@ -29,9 +66,9 @@ jobs:
2966
uses: actions/cache@v4
3067
with:
3168
path: /tmp/.buildx-cache
32-
key: ${{ runner.os }}-buildx-${{ github.sha }}
69+
key: ${{ runner.os }}-${{ matrix.platform }}-buildx-${{ github.sha }}
3370
restore-keys: |
34-
${{ runner.os }}-buildx-
71+
${{ runner.os }}-${{ matrix.platform }}-buildx-
3572
3673
- name: Install dependencies
3774
run: npm install
@@ -40,66 +77,110 @@ jobs:
4077
id: meta
4178
uses: docker/metadata-action@v5
4279
with:
43-
images: freikin/dawarich
80+
images: ${{ secrets.DOCKERHUB_USERNAME }}/dawarich
4481

4582
- name: Login to Docker Hub
4683
uses: docker/login-action@v3.1.0
4784
with:
4885
username: ${{ secrets.DOCKERHUB_USERNAME }}
4986
password: ${{ secrets.DOCKERHUB_TOKEN }}
5087

51-
- name: Set Docker tags
52-
id: docker_meta
88+
- name: Prepare platform pair
89+
id: platform
5390
run: |
54-
# Debug output
55-
echo "GITHUB_REF: $GITHUB_REF"
56-
echo "GITHUB_REF_NAME: $GITHUB_REF_NAME"
91+
PAIR=$(echo "${{ matrix.platform }}" | tr '/' '-')
92+
echo "pair=${PAIR}" >> "$GITHUB_OUTPUT"
5793
58-
# Extract version from GITHUB_REF or use GITHUB_REF_NAME
59-
if [[ $GITHUB_REF == refs/tags/* ]]; then
60-
VERSION=${GITHUB_REF#refs/tags/}
61-
else
62-
VERSION=$GITHUB_REF_NAME
63-
fi
94+
- name: Build and push by digest
95+
id: build
96+
uses: docker/build-push-action@v5
97+
with:
98+
context: .
99+
file: ./docker/Dockerfile
100+
platforms: ${{ matrix.platform }}
101+
outputs: type=image,name=${{ secrets.DOCKERHUB_USERNAME }}/dawarich,push-by-digest=true,name-canonical=true,push=true
102+
labels: ${{ steps.meta.outputs.labels }}
103+
cache-from: type=local,src=/tmp/.buildx-cache
104+
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
64105

65-
# Additional safety check - if VERSION is empty, use a default
66-
if [ -z "$VERSION" ]; then
67-
VERSION="rc"
68-
fi
106+
- name: Rotate cache
107+
run: |
108+
rm -rf /tmp/.buildx-cache
109+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
110+
111+
- name: Export digest
112+
run: |
113+
mkdir -p "${{ runner.temp }}/digests"
114+
DIGEST="${{ steps.build.outputs.digest }}"
115+
touch "${{ runner.temp }}/digests/${DIGEST#sha256:}"
69116
70-
echo "Using VERSION: $VERSION"
117+
- name: Upload digest
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: digest-${{ steps.platform.outputs.pair }}
121+
path: ${{ runner.temp }}/digests/*
122+
if-no-files-found: error
123+
retention-days: 1
71124

72-
TAGS="freikin/dawarich:${VERSION}"
125+
merge:
126+
needs: [prepare, build-and-push-docker]
127+
runs-on: ubuntu-22.04
128+
steps:
129+
- name: Checkout code
130+
uses: actions/checkout@v4
131+
with:
132+
ref: ${{ github.event.inputs.branch || github.ref_name }}
73133

74-
# Set platforms based on version type and release type
75-
PLATFORMS="linux/amd64,linux/arm64,linux/arm/v8,linux/arm/v7"
134+
- name: Login to Docker Hub
135+
uses: docker/login-action@v3.1.0
136+
with:
137+
username: ${{ secrets.DOCKERHUB_USERNAME }}
138+
password: ${{ secrets.DOCKERHUB_TOKEN }}
76139

77-
# Add :rc tag for pre-releases
78-
if [ "${{ github.event.release.prerelease }}" = "true" ]; then
79-
TAGS="${TAGS},freikin/dawarich:rc"
80-
# For RC builds, only use amd64
81-
PLATFORMS="linux/amd64"
82-
fi
140+
- name: Set up Docker Buildx
141+
uses: docker/setup-buildx-action@v3
83142

84-
# Add :latest tag only if release is not a pre-release
85-
if [ "${{ github.event.release.prerelease }}" != "true" ]; then
86-
TAGS="${TAGS},freikin/dawarich:latest"
87-
fi
143+
- name: Download all digests
144+
uses: actions/download-artifact@v4
145+
with:
146+
path: ${{ runner.temp }}/digests
147+
pattern: digest-*
148+
merge-multiple: true
88149

89-
echo "Final TAGS: $TAGS"
90-
echo "PLATFORMS: $PLATFORMS"
150+
- name: Build Docker tags
151+
id: docker_tags
152+
run: |
153+
IMAGE="${{ secrets.DOCKERHUB_USERNAME }}/dawarich"
154+
VERSION="${{ needs.prepare.outputs.version }}"
155+
IS_PRERELEASE="${{ needs.prepare.outputs.is_prerelease }}"
156+
157+
TAGS="${IMAGE}:${VERSION}"
158+
159+
if [ "$IS_PRERELEASE" = "true" ]; then
160+
TAGS="${TAGS},${IMAGE}:rc"
161+
else
162+
TAGS="${TAGS},${IMAGE}:latest"
163+
fi
91164
92165
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
93-
echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT
94166
95-
- name: Build and push
96-
uses: docker/build-push-action@v5
97-
with:
98-
context: .
99-
file: ./docker/Dockerfile
100-
push: true
101-
tags: ${{ steps.docker_meta.outputs.tags }}
102-
labels: ${{ steps.meta.outputs.labels }}
103-
platforms: ${{ steps.docker_meta.outputs.platforms }}
104-
cache-from: type=local,src=/tmp/.buildx-cache
105-
cache-to: type=local,dest=/tmp/.buildx-cache
167+
- name: Create manifest list and push
168+
working-directory: ${{ runner.temp }}/digests
169+
run: |
170+
TAGS="${{ steps.docker_tags.outputs.tags }}"
171+
172+
TAG_ARGS=""
173+
IFS=',' read -ra TAG_LIST <<< "$TAGS"
174+
for TAG in "${TAG_LIST[@]}"; do
175+
TAG_ARGS="${TAG_ARGS} -t ${TAG}"
176+
done
177+
178+
SOURCES=$(printf "${{ secrets.DOCKERHUB_USERNAME }}/dawarich@sha256:%s " *)
179+
180+
docker buildx imagetools create ${TAG_ARGS} ${SOURCES}
181+
182+
- name: Inspect final image
183+
run: |
184+
TAGS="${{ steps.docker_tags.outputs.tags }}"
185+
FIRST_TAG="${TAGS%%,*}"
186+
docker buildx imagetools inspect "${FIRST_TAG}"

.github/workflows/release_notifications.yml

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,53 @@
11
name: Release Notifications
22

33
on:
4-
release:
5-
types: [published]
4+
workflow_run:
5+
workflows: ["Docker image build and push"]
6+
types: [completed]
67

78
permissions:
89
contents: read
910

1011
jobs:
1112
notify:
1213
runs-on: ubuntu-latest
13-
# Only notify for stable releases, not RCs or prereleases
14-
if: ${{ !github.event.release.prerelease }}
14+
# Only run when build succeeded and was triggered by a release
15+
if: >
16+
github.event.workflow_run.conclusion == 'success' &&
17+
github.event.workflow_run.event == 'release'
1518
1619
steps:
1720
- uses: actions/checkout@v4
1821

19-
- name: Set version
22+
- name: Get release info
2023
id: version
24+
env:
25+
GH_TOKEN: ${{ github.token }}
26+
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
27+
REPO: ${{ github.repository }}
2128
run: |
22-
echo "tag=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
23-
echo "url=${{ github.event.release.html_url }}" >> $GITHUB_OUTPUT
29+
# The head_branch of a release-triggered workflow is the tag name
30+
TAG="$HEAD_BRANCH"
31+
32+
# Fetch release details by tag
33+
RELEASE_JSON=$(gh api "repos/$REPO/releases/tags/$TAG" 2>/dev/null || true)
34+
35+
if [ -z "$RELEASE_JSON" ]; then
36+
echo "Could not find release for tag $TAG, trying latest"
37+
RELEASE_JSON=$(gh api "repos/$REPO/releases/latest")
38+
TAG=$(echo "$RELEASE_JSON" | jq -r '.tag_name')
39+
fi
40+
41+
URL=$(echo "$RELEASE_JSON" | jq -r '.html_url')
42+
PRERELEASE=$(echo "$RELEASE_JSON" | jq -r '.prerelease')
43+
44+
echo "tag=$TAG" >> $GITHUB_OUTPUT
45+
echo "url=$URL" >> $GITHUB_OUTPUT
46+
echo "prerelease=$PRERELEASE" >> $GITHUB_OUTPUT
47+
echo "Release: $TAG (prerelease: $PRERELEASE)"
2448
2549
- name: Extract changelog for version
50+
if: steps.version.outputs.prerelease != 'true'
2651
id: changelog
2752
env:
2853
VERSION: ${{ steps.version.outputs.tag }}
@@ -40,6 +65,7 @@ jobs:
4065
echo "EOF" >> $GITHUB_OUTPUT
4166
4267
- name: Generate summary
68+
if: steps.version.outputs.prerelease != 'true'
4369
id: summary
4470
env:
4571
NOTES: ${{ steps.changelog.outputs.notes }}
@@ -63,6 +89,7 @@ jobs:
6389
echo "summary=$PARTS" >> $GITHUB_OUTPUT
6490
6591
- name: Post to Discord
92+
if: steps.version.outputs.prerelease != 'true'
6693
env:
6794
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}
6895
VERSION: ${{ steps.version.outputs.tag }}
@@ -85,6 +112,7 @@ jobs:
85112
"$DISCORD_WEBHOOK"
86113
87114
- name: Post to Mastodon
115+
if: steps.version.outputs.prerelease != 'true'
88116
env:
89117
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
90118
VERSION: ${{ steps.version.outputs.tag }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,5 @@ node_modules/
8585
/blob-report/
8686
/playwright/.cache/
8787
/e2e/temp/
88+
89+
.claude

0 commit comments

Comments
 (0)