Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Update release.yml to only build and attach apps to GitHub release if they match release version

Leendert de Borstc4a8facfde71
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 56b647c8d..73f0ed48e 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -70,7 +70,16 @@ jobs:
tag_latest: ${{ steps.detect.outputs.tag_latest }}
all_in_one_exists: ${{ steps.check-images.outputs.all_in_one_exists }}
multi_container_exists: ${{ steps.check-images.outputs.multi_container_exists }}
+ browser_extension_version_matches: ${{ steps.check-app-versions.outputs.browser_extension_matches }}
+ mobile_app_version_matches: ${{ steps.check-app-versions.outputs.mobile_app_matches }}
steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ sparse-checkout: |
+ apps/browser-extension/package.json
+ apps/mobile-app/app.json
+
- name: Detect version
id: detect
run: |
@@ -147,6 +156,43 @@ jobs:
done
echo "multi_container_exists=${MULTI_EXISTS}" >> $GITHUB_OUTPUT
+ - name: Check app versions match release tag
+ id: check-app-versions
+ run: |
+ VERSION="${{ steps.detect.outputs.version }}"
+ if [ -z "$VERSION" ]; then
+ # No version tag, allow builds (workflow_dispatch without version)
+ echo "browser_extension_matches=true" >> $GITHUB_OUTPUT
+ echo "mobile_app_matches=true" >> $GITHUB_OUTPUT
+ echo "No release version specified, all builds allowed"
+ exit 0
+ fi
+
+ # Check browser extension version
+ BROWSER_EXT_VERSION=$(node -p "require('./apps/browser-extension/package.json').version")
+ echo "Browser extension version: $BROWSER_EXT_VERSION"
+ echo "Release version: $VERSION"
+ if [ "$BROWSER_EXT_VERSION" = "$VERSION" ]; then
+ echo "✅ Browser extension version matches release tag"
+ echo "browser_extension_matches=true" >> $GITHUB_OUTPUT
+ else
+ echo "⚠️ Browser extension version ($BROWSER_EXT_VERSION) does not match release tag ($VERSION)"
+ echo "Browser extensions will NOT be uploaded to release"
+ echo "browser_extension_matches=false" >> $GITHUB_OUTPUT
+ fi
+
+ # Check mobile app version
+ MOBILE_APP_VERSION=$(node -p "require('./apps/mobile-app/app.json').expo.version")
+ echo "Mobile app version: $MOBILE_APP_VERSION"
+ if [ "$MOBILE_APP_VERSION" = "$VERSION" ]; then
+ echo "✅ Mobile app version matches release tag"
+ echo "mobile_app_matches=true" >> $GITHUB_OUTPUT
+ else
+ echo "⚠️ Mobile app version ($MOBILE_APP_VERSION) does not match release tag ($VERSION)"
+ echo "Android APK will NOT be uploaded to release"
+ echo "mobile_app_matches=false" >> $GITHUB_OUTPUT
+ fi
+
upload-install-script:
needs: [valid-release, detect-version]
if: always() && (github.event_name != 'release' || needs.valid-release.result == 'success')
@@ -165,8 +211,8 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
build-chrome-extension:
- needs: [valid-release]
- if: always() && (github.event_name != 'release' || needs.valid-release.result == 'success') && (github.event_name == 'release' || inputs.build_browser_extensions)
+ needs: [valid-release, detect-version]
+ if: always() && (github.event_name != 'release' || needs.valid-release.result == 'success') && (github.event_name == 'release' || inputs.build_browser_extensions) && needs.detect-version.outputs.browser_extension_version_matches == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
@@ -181,8 +227,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-firefox-extension:
- needs: [valid-release]
- if: always() && (github.event_name != 'release' || needs.valid-release.result == 'success') && (github.event_name == 'release' || inputs.build_browser_extensions)
+ needs: [valid-release, detect-version]
+ if: always() && (github.event_name != 'release' || needs.valid-release.result == 'success') && (github.event_name == 'release' || inputs.build_browser_extensions) && needs.detect-version.outputs.browser_extension_version_matches == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
@@ -197,8 +243,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-edge-extension:
- needs: [valid-release]
- if: always() && (github.event_name != 'release' || needs.valid-release.result == 'success') && (github.event_name == 'release' || inputs.build_browser_extensions)
+ needs: [valid-release, detect-version]
+ if: always() && (github.event_name != 'release' || needs.valid-release.result == 'success') && (github.event_name == 'release' || inputs.build_browser_extensions) && needs.detect-version.outputs.browser_extension_version_matches == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
@@ -213,8 +259,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-android-release:
- needs: [valid-release]
- if: always() && (github.event_name != 'release' || needs.valid-release.result == 'success') && (github.event_name == 'release' || inputs.build_mobile_apps)
+ needs: [valid-release, detect-version]
+ if: always() && (github.event_name != 'release' || needs.valid-release.result == 'success') && (github.event_name == 'release' || inputs.build_mobile_apps) && needs.detect-version.outputs.mobile_app_version_matches == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout repository