Skip to content

Commit 35ce2f3

Browse files
committed
chore: sync development → beta
Resolves the merge conflict that blocked the auto-generated promotion PR. Single content conflict (appinfo/info.xml version line) resolved in favor of beta — this IS a release-to-beta promotion.
1 parent 6cc7431 commit 35ce2f3

28 files changed

Lines changed: 6279 additions & 462 deletions

.github/workflows/build-exapp.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Build and Push ExApp Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- beta
8+
tags:
9+
- 'v*'
10+
pull_request:
11+
branches:
12+
- main
13+
14+
env:
15+
REGISTRY: ghcr.io
16+
IMAGE_NAME: conductionnl/openklant-exapp
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
packages: write
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v3
31+
32+
- name: Log in to Container Registry
33+
if: github.event_name != 'pull_request'
34+
uses: docker/login-action@v3
35+
with:
36+
registry: ${{ env.REGISTRY }}
37+
username: ${{ github.actor }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Extract metadata
41+
id: meta
42+
uses: docker/metadata-action@v5
43+
with:
44+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
45+
tags: |
46+
type=ref,event=branch
47+
type=ref,event=pr
48+
type=semver,pattern={{version}}
49+
type=semver,pattern={{major}}.{{minor}}
50+
type=raw,value=latest,enable={{is_default_branch}}
51+
52+
- name: Build and push
53+
uses: docker/build-push-action@v5
54+
with:
55+
context: .
56+
push: ${{ github.event_name != 'pull_request' }}
57+
tags: ${{ steps.meta.outputs.tags }}
58+
labels: ${{ steps.meta.outputs.labels }}
59+
cache-from: type=gha
60+
cache-to: type=gha,mode=max
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Branch Protection
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- beta
8+
9+
jobs:
10+
check-branch:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check branch
14+
run: |
15+
TARGET="${{ github.base_ref }}"
16+
SOURCE="${{ github.head_ref }}"
17+
18+
if [[ "$TARGET" == "main" ]]; then
19+
if [[ "$SOURCE" != "beta" ]] && ! [[ "$SOURCE" =~ ^hotfix ]]; then
20+
echo "Error: Pull requests to main must come from 'beta' or a branch starting with 'hotfix'"
21+
echo "Source branch: $SOURCE"
22+
exit 1
23+
fi
24+
elif [[ "$TARGET" == "beta" ]]; then
25+
if [[ "$SOURCE" != "development" ]] && ! [[ "$SOURCE" =~ ^hotfix ]]; then
26+
echo "Error: Pull requests to beta must come from 'development' or a branch starting with 'hotfix'"
27+
echo "Source branch: $SOURCE"
28+
exit 1
29+
fi
30+
fi
31+
32+
echo "Branch check passed: $SOURCE -> $TARGET"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Lint Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- development
7+
- main
8+
9+
jobs:
10+
lint-check:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Check for package.json
18+
id: has_pkg
19+
run: |
20+
if [ -f package.json ]; then
21+
echo "exists=true" >> "$GITHUB_OUTPUT"
22+
else
23+
echo "exists=false" >> "$GITHUB_OUTPUT"
24+
echo "::notice::No package.json found at repo root; lint-check is a no-op for this repo."
25+
fi
26+
27+
- name: Install dependencies
28+
if: steps.has_pkg.outputs.exists == 'true'
29+
run: npm i
30+
31+
- name: Linting
32+
if: steps.has_pkg.outputs.exists == 'true'
33+
run: npm run lint
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Create PR to Beta
2+
3+
permissions:
4+
contents: write
5+
pull-requests: write
6+
7+
on:
8+
push:
9+
branches:
10+
- development
11+
12+
jobs:
13+
create-pr:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Code
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Create or update PR to beta
22+
env:
23+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: |
25+
# Check if beta branch exists
26+
if ! git ls-remote --heads origin beta | grep -q beta; then
27+
echo "Beta branch does not exist yet. Creating from development..."
28+
git push origin origin/development:refs/heads/beta
29+
fi
30+
31+
# Check if a PR already exists
32+
EXISTING_PR=$(gh pr list --base beta --head development --state open --json number --jq '.[0].number' || echo "")
33+
34+
if [ -n "$EXISTING_PR" ] && [ "$EXISTING_PR" != "null" ]; then
35+
echo "PR #$EXISTING_PR already exists, it will auto-update with new commits"
36+
else
37+
gh pr create \
38+
--base beta \
39+
--head development \
40+
--title "Release: merge development into beta" \
41+
--body "Automated PR to sync development changes to beta for beta release.
42+
43+
Merging this PR will trigger the beta release workflow."
44+
fi
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
name: Unstable Release
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
8+
jobs:
9+
release-management:
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
- name: Checkout Code
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
ssh-key: ${{ secrets.DEPLOY_KEY }}
18+
19+
- name: Set app env
20+
run: |
21+
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
22+
23+
- name: Get current version and append unstable suffix
24+
id: increment_version
25+
run: |
26+
git fetch origin main
27+
main_version=$(git show origin/main:appinfo/info.xml | grep -oP '(?<=<version>)[^<]+' || echo "")
28+
current_version=$(grep -oP '(?<=<version>)[^<]+' appinfo/info.xml || echo "")
29+
30+
IFS='.' read -ra main_version_parts <<< "$main_version"
31+
next_patch=$((main_version_parts[2] + 1))
32+
33+
unstable_counter=1
34+
if [[ $current_version =~ -unstable\.([0-9]+)$ ]]; then
35+
current_patch=$(echo $current_version | grep -oP '^[0-9]+\.[0-9]+\.(\d+)' | cut -d. -f3)
36+
if [ "$current_patch" -eq "$next_patch" ]; then
37+
unstable_counter=$((BASH_REMATCH[1] + 1))
38+
fi
39+
fi
40+
41+
unstable_version="${main_version_parts[0]}.${main_version_parts[1]}.${next_patch}-unstable.${unstable_counter}"
42+
43+
echo "NEW_VERSION=$unstable_version" >> $GITHUB_ENV
44+
echo "new_version=$unstable_version" >> $GITHUB_OUTPUT
45+
echo "Main version: $main_version"
46+
echo "Current version: $current_version"
47+
echo "Using unstable version: $unstable_version"
48+
49+
- name: Update version in info.xml
50+
run: |
51+
sed -i "s|<version>.*</version>|<version>${{ env.NEW_VERSION }}</version>|" appinfo/info.xml
52+
53+
- name: Commit version update
54+
run: |
55+
git config --local user.email "action@github.com"
56+
git config --local user.name "GitHub Action"
57+
58+
if git diff --quiet && git diff --cached --quiet; then
59+
echo "No changes to commit"
60+
else
61+
git add appinfo/info.xml
62+
git commit -m "Bump unstable version to ${{ env.NEW_VERSION }} [skip ci]"
63+
git push
64+
fi
65+
66+
- name: Prepare Signing Certificate and Key
67+
run: |
68+
echo "${{ secrets.NEXTCLOUD_SIGNING_CERT }}" > signing-cert.crt
69+
echo "${{ secrets.NEXTCLOUD_SIGNING_KEY }}" > signing-key.key
70+
71+
- name: Install npm dependencies
72+
uses: actions/setup-node@v3
73+
with:
74+
node-version: '18.x'
75+
76+
- name: Set up PHP and install extensions
77+
uses: shivammathur/setup-php@v2
78+
with:
79+
php-version: '8.2'
80+
extensions: zip, gd
81+
82+
- run: npm ci
83+
- run: npm run build
84+
- run: composer install --no-dev --optimize-autoloader --classmap-authoritative
85+
86+
- name: Copy the package files into the package
87+
run: |
88+
mkdir -p package/${{ github.event.repository.name }}
89+
rsync -av --progress \
90+
--exclude='/package' \
91+
--exclude='/.git' \
92+
--exclude='/.github' \
93+
--exclude='/.cursor' \
94+
--exclude='/.vscode' \
95+
--exclude='/node_modules' \
96+
--exclude='/src' \
97+
--exclude='/tests' \
98+
--exclude='/package.json' \
99+
--exclude='/package-lock.json' \
100+
--exclude='/composer.json' \
101+
--exclude='/composer.lock' \
102+
--exclude='/phpcs.xml' \
103+
--exclude='/phpmd.xml' \
104+
--exclude='/psalm.xml' \
105+
--exclude='/phpunit.xml' \
106+
--exclude='/.phpunit.cache' \
107+
--exclude='.phpunit.result.cache' \
108+
--exclude='/jest.config.js' \
109+
--exclude='/webpack.config.js' \
110+
--exclude='/tsconfig.json' \
111+
--exclude='/.babelrc' \
112+
--exclude='/.eslintrc.js' \
113+
--exclude='/.prettierrc' \
114+
--exclude='/stylelint.config.js' \
115+
--exclude='/.gitignore' \
116+
--exclude='/.gitattributes' \
117+
--exclude='/signing-key.key' \
118+
--exclude='/signing-cert.crt' \
119+
./ package/${{ github.event.repository.name }}/
120+
121+
- name: Create Tarball
122+
run: |
123+
cd package && tar -czf ../nextcloud-release.tar.gz ${{ github.event.repository.name }}
124+
125+
- name: Sign the TAR.GZ file with OpenSSL
126+
run: |
127+
openssl dgst -sha512 -sign signing-key.key nextcloud-release.tar.gz | openssl base64 -out nextcloud-release.signature
128+
129+
- name: Upload tarball as artifact
130+
uses: actions/upload-artifact@v4
131+
with:
132+
name: nextcloud-release-${{ env.NEW_VERSION }}
133+
path: |
134+
nextcloud-release.tar.gz
135+
nextcloud-release.signature
136+
retention-days: 30
137+
138+
- name: Git Version
139+
id: version
140+
uses: codacy/git-version@2.7.1
141+
with:
142+
release-branch: development
143+
144+
- name: Upload Unstable Release
145+
uses: ncipollo/release-action@v1.12.0
146+
with:
147+
tag: v${{ env.NEW_VERSION }}
148+
name: Unstable Release ${{ env.NEW_VERSION }}
149+
draft: false
150+
prerelease: true
151+
skipIfReleaseExists: true
152+
153+
- name: Attach tarball to GitHub release
154+
uses: svenstaro/upload-release-action@v2
155+
with:
156+
repo_token: ${{ secrets.GITHUB_TOKEN }}
157+
file: nextcloud-release.tar.gz
158+
asset_name: ${{ env.APP_NAME }}-${{ env.NEW_VERSION }}.tar.gz
159+
tag: v${{ env.NEW_VERSION }}
160+
overwrite: true
161+
162+
- name: Upload app to Nextcloud appstore
163+
uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1
164+
with:
165+
app_name: ${{ env.APP_NAME }}
166+
appstore_token: ${{ secrets.NEXTCLOUD_APPSTORE_TOKEN }}
167+
download_url: https://github.com/${{ github.repository }}/releases/download/v${{ env.NEW_VERSION }}/${{ env.APP_NAME }}-${{ env.NEW_VERSION }}.tar.gz
168+
app_private_key: ${{ secrets.NEXTCLOUD_SIGNING_KEY }}
169+
nightly: true
170+
171+
- name: Verify release
172+
run: |
173+
echo "App version: ${{ env.NEW_VERSION }}"
174+
echo "Tarball contents:"
175+
tar -tvf nextcloud-release.tar.gz | head -50
176+
echo "info.xml contents:"
177+
tar -xOf nextcloud-release.tar.gz ${{ env.APP_NAME }}/appinfo/info.xml

0 commit comments

Comments
 (0)