High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
feat: cut releases from release branches (#31033)
bo0tzza366db1494f0
diff --git a/.github/workflows/build-mobile.yml b/.github/workflows/build-mobile.ymlindex 6a9a01d41d..68744fada6 100644--- a/.github/workflows/build-mobile.yml+++ b/.github/workflows/build-mobile.yml@@ -38,7 +38,7 @@ on:required: truepull_request:push:- branches: [main]+ branches: [main, 'release/*']concurrency:group: ${{ github.workflow }}-${{ github.ref }}@@ -46,6 +46,9 @@ concurrency:permissions: {}+env:+ DEPLOY: ${{ inputs.environment == 'production' || github.ref == 'refs/heads/main' }}+jobs:pre-job:runs-on: ubuntu-latest@@ -143,10 +146,9 @@ jobs:ALIAS: ${{ secrets.ALIAS }}ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}- IS_MAIN: ${{ github.ref == 'refs/heads/main' }}PR_NUMBER: ${{ github.event.pull_request.number }}run: |- if [[ $IS_MAIN == 'true' ]]; then+ if [[ $DEPLOY == 'true' ]]; thenflutter build apk --releaseflutter build apk --release --split-per-abi --target-platform android-arm,android-arm64,android-x64else@@ -229,7 +231,7 @@ jobs:uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0with:ruby-version: '3.3'- bundler-cache: true+ bundler-cache: true # zizmor: ignore[cache-poisoning] release branches cannot read caches written by pull requestsworking-directory: ./mobile/ios- name: Install dependencies@@ -288,21 +290,16 @@ jobs:APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}ENVIRONMENT: ${{ inputs.environment || 'development' }}- GITHUB_REF: ${{ github.ref }}FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 120FASTLANE_XCODEBUILD_SETTINGS_RETRIES: 6working-directory: ./mobile/iosrun: |- # Only upload to TestFlight on main branch- if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then- if [[ "$ENVIRONMENT" == "development" ]]; then- bundle exec fastlane gha_testflight_dev- else- bundle exec fastlane gha_release_prod- fi- else- # Build only, no TestFlight upload for non-main branches+ if [[ "$DEPLOY" != 'true' ]]; thenbundle exec fastlane gha_build_only+ elif [[ "$ENVIRONMENT" == "development" ]]; then+ bundle exec fastlane gha_testflight_dev+ else+ bundle exec fastlane gha_release_prodfi- name: Clean up keychaindiff --git a/.github/workflows/cli.yml b/.github/workflows/cli.ymlindex cb20a017fa..abc075259b 100644--- a/.github/workflows/cli.yml+++ b/.github/workflows/cli.yml@@ -1,7 +1,7 @@name: CLI Buildon:push:- branches: [main]+ branches: [main, 'release/*']paths:- 'packages/cli/**'- '.github/workflows/cli.yml'diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.ymlindex ed1246cee4..18ffcb2369 100644--- a/.github/workflows/docker.yml+++ b/.github/workflows/docker.yml@@ -3,7 +3,7 @@ name: Dockeron:workflow_dispatch:push:- branches: [main]+ branches: [main, 'release/*']pull_request:release:types: [published]diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.ymlindex e0c5de3fab..e7911d97f4 100644--- a/.github/workflows/docs-build.yml+++ b/.github/workflows/docs-build.yml@@ -1,7 +1,7 @@name: Docs buildon:push:- branches: [main]+ branches: [main, 'release/*']pull_request:release:types: [published]diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.ymlindex a8cebb7cd9..78f7a57fe9 100644--- a/.github/workflows/draft-release.yml+++ b/.github/workflows/draft-release.yml@@ -18,6 +18,18 @@ jobs:sha: ${{ steps.version.outputs.sha }}permissions: {}steps:+ - name: Check this is a release branch+ env:+ BRANCH: ${{ github.ref_name }}+ run: |+ case "${BRANCH}" in+ release/*) ;;+ *)+ echo "::error::releases are drafted from a release branch, not ${BRANCH}"+ exit 1+ ;;+ esac+- id: tokenuses: immich-app/devtools/actions/create-workflow-token@1af396ae134e4bc3b63d947e672bc68bf4ff9dc5 # create-workflow-token-action-v3.0.0with:diff --git a/.github/workflows/migration-order.yml b/.github/workflows/migration-order.ymlindex 94708b4869..9975c87e21 100644--- a/.github/workflows/migration-order.yml+++ b/.github/workflows/migration-order.yml@@ -3,7 +3,7 @@ name: Migration Orderon:pull_request:push:- branches: [main]+ branches: [main, 'release/*']concurrency:group: ${{ github.workflow }}-${{ github.ref }}@@ -14,6 +14,7 @@ permissions: {}jobs:migration-order:name: Verify migration ORDER+ if: ${{ !github.event.created }}runs-on: ubuntu-latestpermissions:contents: readdiff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.ymlindex aa26603f10..0fef2ac241 100644--- a/.github/workflows/prepare-release.yml+++ b/.github/workflows/prepare-release.yml@@ -6,15 +6,12 @@ on:releaseType:description: 'Release type'required: true- default: 'false'+ default: 'preminor'type: choiceoptions:- - 'false'- - minor- - patch- premajor- preminor- - prepatch+ - patch- prerelease- releaseskipTranslations:@@ -32,7 +29,7 @@ jobs:merge_translations:uses: ./.github/workflows/merge-translations.ymlwith:- skip: ${{ inputs.skipTranslations }}+ skip: ${{ inputs.skipTranslations || github.ref_name != 'main' }}permissions:pull-requests: writesecrets:@@ -47,6 +44,20 @@ jobs:version: ${{ steps.output.outputs.version }}permissions: {}steps:+ - name: Check the release type suits this branch+ env:+ BRANCH: ${{ github.ref_name }}+ RELEASE_TYPE: ${{ inputs.releaseType }}+ run: |+ case "${BRANCH}:${RELEASE_TYPE}" in+ main:premajor | main:preminor) ;;+ release/*:patch | release/*:prerelease | release/*:release) ;;+ *)+ echo "::error::${RELEASE_TYPE} cannot be released from ${BRANCH}"+ exit 1+ ;;+ esac+- id: tokenuses: immich-app/devtools/actions/create-workflow-token@1af396ae134e4bc3b63d947e672bc68bf4ff9dc5 # create-workflow-token-action-v3.0.0with:@@ -59,7 +70,6 @@ jobs:with:token: ${{ steps.token.outputs.token }}persist-credentials: true- ref: main- name: Setup Miseuses: immich-app/devtools/actions/use-mise@06a9ef925332c91be647d6256642b86b398592c8 # use-mise-action-v3.2.1@@ -87,3 +97,11 @@ jobs:git add -Agit commit -m "chore: version ${VERSION}"git push++ - name: Cut the release branch+ if: ${{ github.ref_name == 'main' }}+ env:+ VERSION: ${{ steps.output.outputs.version }}+ run: |+ line=$(sed -E 's/^(v[0-9]+\.[0-9]+).*/\1/' <<< "${VERSION}")+ git push origin "HEAD:refs/heads/release/${line}"diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.ymlindex 0a3c61668c..e53375f64a 100644--- a/.github/workflows/static_analysis.yml+++ b/.github/workflows/static_analysis.yml@@ -3,7 +3,7 @@ on:workflow_dispatch:pull_request:push:- branches: [main]+ branches: [main, 'release/*']concurrency:group: ${{ github.workflow }}-${{ github.ref }}diff --git a/.github/workflows/test.yml b/.github/workflows/test.ymlindex 8a4ecceb14..5da8fd0002 100644--- a/.github/workflows/test.yml+++ b/.github/workflows/test.yml@@ -3,7 +3,7 @@ on:workflow_dispatch:pull_request:push:- branches: [main]+ branches: [main, 'release/*']concurrency:group: ${{ github.workflow }}-${{ github.ref }}cancel-in-progress: truediff --git a/packages/scripts/src/commands/release.spec.ts b/packages/scripts/src/commands/release.spec.tsindex dc3f82517d..76931edcd4 100644--- a/packages/scripts/src/commands/release.spec.ts+++ b/packages/scripts/src/commands/release.spec.ts@@ -32,6 +32,13 @@ describe(getNewVersion.name, () => {['release', '2.8.0-rc.1', '2.8.0'],],},+ {+ name: 'cutting the next line while on a prerelease',+ items: [+ ['preminor', '3.3.0-rc.0', '3.4.0-rc.0'],+ ['premajor', '3.3.0-rc.0', '4.0.0-rc.0'],+ ],+ },{name: 'premajor',items: [@@ -58,8 +65,6 @@ describe(getNewVersion.name, () => {['patch', 'v3.0.0-rc.0'],['prepatch', 'v3.0.0-rc.0'],['minor', 'v3.0.0-rc.0'],- ['preminor', 'v3.0.0-rc.0'],- ['premajor', 'v3.0.0-rc.0'],['prerelease', 'v3.0.0'],['release', 'v3.0.0'],])('should not allow a $0 on $1', (type, version) => {diff --git a/packages/scripts/src/commands/release.ts b/packages/scripts/src/commands/release.tsindex 2c0d82d5f6..78e5027bd7 100644--- a/packages/scripts/src/commands/release.ts+++ b/packages/scripts/src/commands/release.ts@@ -123,15 +123,20 @@ export const getNewVersion = (versionRaw: string, type: string) => {switch (type) {case 'patch':case 'prepatch':- case 'minor':- case 'preminor':- case 'premajor': {+ case 'minor': {newVersionRaw = inc(version, type);// can only use while not in a prereleasevalid = !isPrerelease(version);break;}+ case 'preminor':+ case 'premajor': {+ // cutting the next release line is allowed while main sits on a prerelease+ newVersionRaw = inc(version, type);+ break;+ }+case 'prerelease': {newVersionRaw = inc(version, type);// can only use while in a prerelease