|
6 | 6 | - dev |
7 | 7 | - 'release/**' |
8 | 8 | - 'hotfix/**' |
| 9 | + tags: |
| 10 | + - v*.*.* |
9 | 11 | paths-ignore: |
10 | 12 | - "*.md" |
11 | 13 | - "LICENSE" |
@@ -53,22 +55,25 @@ jobs: |
53 | 55 | - name: Build iOS |
54 | 56 | run: flutter build ipa --release --obfuscate --split-debug-info=build/debug-info --build-number=${{ github.run_number }} |
55 | 57 |
|
56 | | - # Temporarily disable uploading artifacts until quota gets recalculated. |
57 | | - # Error: Failed to CreateArtifact: Artifact storage quota has been hit. Unable to upload any new artifacts. Usage is recalculated every 6-12 hours. |
58 | | - # - name: Upload iOS artifact |
59 | | - # uses: actions/upload-artifact@v4 |
60 | | - # with: |
61 | | - # name: ios |
62 | | - # retention-days: 3 |
63 | | - # path: client/build/ios/ipa/*.ipa |
64 | | - |
65 | 58 | - name: Upload app to TestFlight |
66 | 59 | uses: apple-actions/upload-testflight-build@v3 |
| 60 | + # Mobile applications are published to the App Store manually, with release tags applied |
| 61 | + # post-publication. To avoid redundant uploads, this step executes only for non-tagged |
| 62 | + # builds, ensuring tagged releases are distributed exclusively to GitHub. |
| 63 | + if: "!startsWith(github.ref, 'refs/tags/')" |
67 | 64 | with: |
68 | 65 | app-path: "client/build/ios/ipa/Defguard.ipa" |
69 | 66 | issuer-id: ${{ secrets.API_ISSUER_ID }} |
70 | 67 | api-key-id: ${{ secrets.ASC_API_KEY_ID }} |
71 | 68 | api-private-key: ${{ secrets.PRIVATE_KEY_CONTENTS }} |
| 69 | + |
| 70 | + - name: Upload iOS Artifact |
| 71 | + uses: actions/upload-artifact@v4 |
| 72 | + if: startsWith(github.ref, 'refs/tags/') |
| 73 | + with: |
| 74 | + name: ios-app |
| 75 | + path: "client/build/ios/ipa/Defguard.ipa" |
| 76 | + retention-days: 2 |
72 | 77 |
|
73 | 78 | build-android: |
74 | 79 | runs-on: [self-hosted, macOS] |
@@ -114,19 +119,30 @@ jobs: |
114 | 119 | keyStorePassword: "${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" |
115 | 120 | keyPassword: "${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" |
116 | 121 |
|
117 | | - # Temporarily disable uploading artifacts until quota gets recalculated. |
118 | | - # Error: Failed to CreateArtifact: Artifact storage quota has been hit. Unable to upload any new artifacts. Usage is recalculated every 6-12 hours. |
119 | | - # - name: Upload android artifact |
120 | | - # uses: actions/upload-artifact@v4 |
121 | | - # with: |
122 | | - # name: android |
123 | | - # retention-days: 3 |
124 | | - # path: client/build/app/outputs/bundle/release/app-release.aab |
125 | | - |
126 | 122 | - name: Publish to Play Store |
127 | 123 | uses: r0adkll/upload-google-play@v1 |
| 124 | + # Mobile applications are published to the Play Store manually, with release tags applied |
| 125 | + # post-publication. To avoid redundant uploads, this step executes only for non-tagged |
| 126 | + # builds, ensuring tagged releases are distributed exclusively to GitHub. |
| 127 | + if: "!startsWith(github.ref, 'refs/tags/')" |
128 | 128 | with: |
129 | 129 | serviceAccountJsonPlainText: "${{ secrets.ANDROID_SERVICE_ACCOUNT_JSON }}" |
130 | 130 | packageName: net.defguard.mobile |
131 | 131 | releaseFiles: client/build/app/outputs/bundle/release/app-release.aab |
132 | 132 | track: internal |
| 133 | + |
| 134 | + - name: Upload Android Artifact |
| 135 | + uses: actions/upload-artifact@v4 |
| 136 | + if: startsWith(github.ref, 'refs/tags/') |
| 137 | + with: |
| 138 | + name: android-app |
| 139 | + path: "client/build/app/outputs/bundle/release/app-release.aab" |
| 140 | + retention-days: 2 |
| 141 | + |
| 142 | + release: |
| 143 | + needs: [build-ios, build-android] |
| 144 | + # Create release only if CI was triggered by a tag. |
| 145 | + if: startsWith(github.ref, 'refs/tags/') |
| 146 | + uses: ./.github/workflows/release.yaml |
| 147 | + secrets: |
| 148 | + PRIVATE_REPO_CLONING_TOKEN: ${{ secrets.PRIVATE_REPO_CLONING_TOKEN }} |
0 commit comments