Skip to content

High performance self-hosted photo and video management solution.

chore: prepare-release workflow tweaks (#21833)

bo0tzzf7acf1886c18
diff --git a/.github/workflows/merge-translations.yml b/.github/workflows/merge-translations.yml
index a0329c8f73..d65567d400 100644
--- a/.github/workflows/merge-translations.yml
+++ b/.github/workflows/merge-translations.yml
@@ -10,6 +10,11 @@ on:
required: true
WEBLATE_TOKEN:
required: true
+ inputs:
+ skip:
+ description: 'Skip translations'
+ required: false
+ type: boolean
permissions: {}
@@ -25,6 +30,7 @@ jobs:
steps:
- name: Find translation PR
id: find_pr
+ if: ${{ inputs.skip != true }}
env:
GH_TOKEN: ${{ github.token }}
run: |
@@ -51,18 +57,21 @@ jobs:
- name: Generate a token
id: generate_token
+ if: ${{ inputs.skip != true }}
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1
with:
app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }}
private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }}
- name: Lock weblate
+ if: ${{ inputs.skip != true }}
env:
WEBLATE_TOKEN: ${{ secrets.WEBLATE_TOKEN }}
run: |
curl --fail-with-body -X POST -H "Authorization: Token $WEBLATE_TOKEN" "$WEBLATE_HOST/api/components/$WEBLATE_COMPONENT/lock/" -d lock=true
- name: Commit translations
+ if: ${{ inputs.skip != true }}
env:
WEBLATE_TOKEN: ${{ secrets.WEBLATE_TOKEN }}
run: |
@@ -71,6 +80,7 @@ jobs:
- name: Merge PR
id: merge_pr
+ if: ${{ inputs.skip != true }}
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
PR_NUMBER: ${{ steps.find_pr.outputs.PR_NUMBER }}
@@ -83,6 +93,7 @@ jobs:
gh pr merge "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --auto --squash
- name: Wait for PR to merge
+ if: ${{ inputs.skip != true }}
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
PR_NUMBER: ${{ steps.find_pr.outputs.PR_NUMBER }}
@@ -106,7 +117,12 @@ jobs:
exit 1
- name: Unlock weblate
+ if: ${{ inputs.skip != true }}
env:
WEBLATE_TOKEN: ${{ secrets.WEBLATE_TOKEN }}
run: |
curl --fail-with-body -X POST -H "Authorization: Token $WEBLATE_TOKEN" "$WEBLATE_HOST/api/components/$WEBLATE_COMPONENT/lock/" -d lock=false
+
+ - name: Report success
+ run: |
+ echo "Workflow completed successfully (or was skipped)"
diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml
index add68ffbd7..3d31a4a377 100644
--- a/.github/workflows/prepare-release.yml
+++ b/.github/workflows/prepare-release.yml
@@ -10,12 +10,17 @@ on:
type: choice
options:
- 'false'
+ - major
- minor
- patch
mobileBump:
description: 'Bump mobile build number'
required: false
type: boolean
+ skipTranslations:
+ description: 'Skip translations'
+ required: false
+ type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-root
@@ -26,6 +31,8 @@ permissions: {}
jobs:
merge_translations:
uses: ./.github/workflows/merge-translations.yml
+ with:
+ skip: ${{ inputs.skipTranslations }}
permissions:
pull-requests: write
secrets:
@@ -35,6 +42,7 @@ jobs:
bump_version:
runs-on: ubuntu-latest
+ needs: [merge_translations]
outputs:
ref: ${{ steps.push-tag.outputs.commit_long_sha }}
permissions: {} # No job-level permissions are needed because it uses the app-token