Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Refactor auth-beta-release: unify checksums and remove redundant version computation

Prateek Sunal60f8ccec793b
diff --git a/.github/workflows/auth-beta-release.yml b/.github/workflows/auth-beta-release.yml
index e78ff47d24..f7fa400f5a 100644
--- a/.github/workflows/auth-beta-release.yml
+++ b/.github/workflows/auth-beta-release.yml
@@ -233,11 +233,15 @@ jobs:
build-windows:
runs-on: windows-latest
environment: "auth-win-build"
+ needs: build-android-linux
defaults:
run:
working-directory: mobile/apps/auth
+ env:
+ VERSION_NAME: ${{ needs.build-android-linux.outputs.version_name }}
+
steps:
- name: Checkout code and submodules
uses: actions/checkout@v4
@@ -252,21 +256,6 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- - name: Increment version code for build
- run: |
- $CURRENT_VERSION = (Select-String -Path pubspec.yaml -Pattern '^version:').Line -replace 'version: ', ''
- $VERSION_NAME = $CURRENT_VERSION.Split('+')[0]
- $CURRENT_BUILD = $CURRENT_VERSION.Split('+')[1]
- $NEW_VERSION_CODE = [int]$CURRENT_BUILD + ${{ github.run_number }}
- $NEW_VERSION = "${VERSION_NAME}+${NEW_VERSION_CODE}"
-
- (Get-Content pubspec.yaml) -replace '^version: .*', "version: $NEW_VERSION" | Set-Content pubspec.yaml
- Write-Output "Building with version $NEW_VERSION"
-
- # Store version for later use
- "VERSION_NAME=${VERSION_NAME}" | Out-File -FilePath $env:GITHUB_ENV -Append
- shell: pwsh
-
- name: Create artifacts directory
run: mkdir artifacts
@@ -318,11 +307,15 @@ jobs:
build-macos:
runs-on: macos-13 # latest is 12
+ needs: build-android-linux
defaults:
run:
working-directory: mobile/apps/auth
+ env:
+ VERSION_NAME: ${{ needs.build-android-linux.outputs.version_name }}
+
steps:
- name: Checkout code and submodules
uses: actions/checkout@v4
@@ -337,20 +330,6 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- - name: Increment version code for build
- run: |
- CURRENT_VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //')
- VERSION_NAME=$(echo $CURRENT_VERSION | cut -d'+' -f1)
- CURRENT_BUILD=$(echo $CURRENT_VERSION | cut -d'+' -f2)
- NEW_VERSION_CODE=$((CURRENT_BUILD + ${{ github.run_number }}))
- NEW_VERSION="${VERSION_NAME}+${NEW_VERSION_CODE}"
-
- sed -i '' "s/^version: .*/version: $NEW_VERSION/" pubspec.yaml
- echo "Building with version ${NEW_VERSION}"
-
- # Store version for later use
- echo "VERSION_NAME=${VERSION_NAME}" >> $GITHUB_ENV
-
- name: Install code signing dependencies
run: |
pip3 install codemagic-cli-tools
@@ -453,6 +432,14 @@ jobs:
path: mobile/apps/auth/artifacts
merge-multiple: true
+ - name: Combine checksums into single file
+ run: |
+ cd artifacts
+ cat sha256sum-* > sha256sum
+ rm sha256sum-apk sha256sum-linux sha256sum-windows sha256sum-macos
+ echo "βœ… Unified checksum file created:"
+ cat sha256sum
+
- name: Create and push tag
run: |
git config user.name "github-actions[bot]"