From f5338fc8a8852592dba4166a9bbdf6fdfac1ea9e Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sat, 7 Jan 2023 19:51:08 +0900 Subject: [PATCH] Fix CI --- .github/workflows/analysis.yml | 4 +-- .github/workflows/documentation.yml | 5 ++-- .github/workflows/native-build.yml | 30 +++++++++++----------- .github/workflows/native-update.yml | 18 +++++-------- .github/workflows/release.yml | 1 + .github/workflows/robot.yml | 3 ++- .github/workflows/tests.yml | 1 + front/apps/mobile/app.config.js | 6 +++++ front/apps/mobile/eas.json | 1 + front/apps/mobile/package.json | 3 ++- front/package.json | 4 ++- front/yarn.lock | 39 +++++++++++++++++++++++++++++ 12 files changed, 80 insertions(+), 35 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 39e4f16a..0b30aa3c 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -44,7 +44,7 @@ jobs: if: github.event_name != 'pull_request' with: ref: ${{github.ref}} - check-name: tests + check-name: "Back tests" repo-token: ${{secrets.GITHUB_TOKEN}} running-workflow-name: analysis allowed-conclusions: success,skipped,cancelled,neutral,failure @@ -53,7 +53,7 @@ jobs: if: github.event_name == 'pull_request' with: ref: ${{github.event.pull_request.head.sha}} - check-name: tests + check-name: "Back tests" repo-token: ${{secrets.GITHUB_TOKEN}} running-workflow-name: analysis allowed-conclusions: success,skipped,cancelled,neutral,failure diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index cd5afdb0..48fe8aac 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,4 +1,4 @@ -name: Update the documentation +name: Documentation on: push: @@ -6,7 +6,8 @@ on: - master jobs: - Building: + doc: + name: Update the documentation runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/native-build.yml b/.github/workflows/native-build.yml index 8df61573..86330a40 100644 --- a/.github/workflows/native-build.yml +++ b/.github/workflows/native-build.yml @@ -1,5 +1,10 @@ name: Native build -on: push +on: + push: + branches: + - master + - next + pull_request: jobs: update: @@ -9,6 +14,9 @@ jobs: run: working-directory: ./front steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Check for EXPO_TOKEN run: | if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then @@ -16,14 +24,12 @@ jobs: exit 1 fi - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node uses: actions/setup-node@v2 with: node-version: 16.x cache: yarn + cache-dependency-path: front/yarn.lock - name: Setup Expo uses: expo/expo-github-action@v7 @@ -32,25 +38,18 @@ jobs: eas-version: latest token: ${{ secrets.EXPO_TOKEN }} - - name: Restore cache - uses: actions/cache@v2 - with: - path: ${{ steps.yarn-cache-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: ${{ runner.os }}-yarn- - - name: Install dependencies run: yarn install --immutable - name: Build Mobile Release - run: yarn build:mobile --release-channel=build | tee log.txt + run: yarn build:mobile | tee log.txt - name: Parse Asset URL id: url run: | - ASSET_URL=$(grep -eo 'https?://expo\.io/artifacts/[^ ]+' log.txt) + ASSET_URL=$(grep -oe 'https?://expo\.io/artifacts/[^ ]+' log.txt) echo The android url is $ASSET_URL - echo "::set-output name=assetUrl::$ASSET_URL" + echo "assetUrl=$ASSET_URL" >> $GITHUB_OUTPUT - name: Download APK Asset run: wget -O kyoo.apk ${{ steps.url.outputs.assetUrl }} @@ -60,11 +59,10 @@ jobs: name: kyoo.apk path: ./front/kyoo.apk - - name: Upload Release Asset uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ./example-${{ env.GITHUB_REF_SLUG }}.apk asset_name: example-${{ env.GITHUB_REF_SLUG }}.apk - tag: ${{ github.ref } + tag: ${{ github.ref }} diff --git a/.github/workflows/native-update.yml b/.github/workflows/native-update.yml index 35610852..3eb3e720 100644 --- a/.github/workflows/native-update.yml +++ b/.github/workflows/native-update.yml @@ -1,5 +1,9 @@ name: Native update -on: push +on: + push: + branches: + - master + - next jobs: update: @@ -24,6 +28,7 @@ jobs: with: node-version: 16.x cache: yarn + cache-dependency-path: front/yarn.lock - name: Setup Expo uses: expo/expo-github-action@v7 @@ -32,17 +37,6 @@ jobs: eas-version: latest token: ${{ secrets.EXPO_TOKEN }} - - name: Find yarn cache - id: yarn-cache-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - name: Restore cache - uses: actions/cache@v2 - with: - path: ${{ steps.yarn-cache-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: ${{ runner.os }}-yarn- - - name: Install dependencies run: yarn install --immutable diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d5dd511..4b964d72 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,7 @@ on: jobs: release: + name: Release a new version runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/robot.yml b/.github/workflows/robot.yml index 3d5982e7..0d10fbc9 100644 --- a/.github/workflows/robot.yml +++ b/.github/workflows/robot.yml @@ -8,7 +8,8 @@ on: jobs: - build: + test: + name: Run Robot Tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 56bc72a6..762960ee 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,6 +8,7 @@ on: jobs: tests: + name: Back tests runs-on: ubuntu-latest container: mcr.microsoft.com/dotnet/sdk:6.0 services: diff --git a/front/apps/mobile/app.config.js b/front/apps/mobile/app.config.js index 032cb6dd..84cc9ac6 100644 --- a/front/apps/mobile/app.config.js +++ b/front/apps/mobile/app.config.js @@ -58,6 +58,12 @@ const config = { }, splash, }, + updates: { + url: "https://u.expo.dev/55de6b52-c649-4a15-9a45-569ff5ed036c", + }, + runtimeVersion: { + policy: "sdkVersion", + }, extra: { eas: { projectId: "55de6b52-c649-4a15-9a45-569ff5ed036c", diff --git a/front/apps/mobile/eas.json b/front/apps/mobile/eas.json index 8e28817a..65330ce4 100644 --- a/front/apps/mobile/eas.json +++ b/front/apps/mobile/eas.json @@ -14,6 +14,7 @@ "distribution": "internal" }, "production": { + "channel": "prod", "android": { "buildType": "apk" } diff --git a/front/apps/mobile/package.json b/front/apps/mobile/package.json index bf291368..e66b3c9c 100644 --- a/front/apps/mobile/package.json +++ b/front/apps/mobile/package.json @@ -9,7 +9,7 @@ "web": "expo start --web", "build": "eas build --profile production --platform android", "build:dev": "eas build --profile development --platform android", - "update": "eas update --auto" + "update": "eas update --auto --channel prod" }, "dependencies": { "@expo-google-fonts/poppins": "^0.2.2", @@ -31,6 +31,7 @@ "expo-router": "^0.0.36", "expo-screen-orientation": "~5.0.1", "expo-status-bar": "~1.4.2", + "expo-updates": "~0.15.6", "i18next": "^22.0.6", "intl-pluralrules": "^1.3.1", "moti": "^0.21.0", diff --git a/front/package.json b/front/package.json index 9008d35a..64bb65c8 100644 --- a/front/package.json +++ b/front/package.json @@ -11,7 +11,9 @@ "update": "yarn workspace mobile update", "lint": "eslint ." }, - "eslintIgnore": ["next-env.d.ts"], + "eslintIgnore": [ + "next-env.d.ts" + ], "workspaces": [ "apps/*", "packages/*" diff --git a/front/yarn.lock b/front/yarn.lock index ce2d9c79..f4eda712 100644 --- a/front/yarn.lock +++ b/front/yarn.lock @@ -6739,6 +6739,13 @@ __metadata: languageName: node linkType: hard +"expo-eas-client@npm:~0.4.0": + version: 0.4.1 + resolution: "expo-eas-client@npm:0.4.1" + checksum: 8d2bd620278d9baba5b65fb42bd18916fcae0883bfc2a02ac72b5318833d8baaccf7be536dcdea1c3a3893793f79dab15c35948450f274b98236db6b491e175c + languageName: node + linkType: hard + "expo-error-recovery@npm:~4.0.1": version: 4.0.1 resolution: "expo-error-recovery@npm:4.0.1" @@ -6926,6 +6933,13 @@ __metadata: languageName: node linkType: hard +"expo-structured-headers@npm:~3.0.0": + version: 3.0.1 + resolution: "expo-structured-headers@npm:3.0.1" + checksum: 3c730146ff3d6beb89967684d58b68dc5feb350600911eb8b0c45820cf13c87b253eb3788dd5c19644df0e3ed091967a2263b8e4459ee4bc62e86ee164ad59ff + languageName: node + linkType: hard + "expo-updates-interface@npm:~0.8.0": version: 0.8.1 resolution: "expo-updates-interface@npm:0.8.1" @@ -6935,6 +6949,30 @@ __metadata: languageName: node linkType: hard +"expo-updates@npm:~0.15.6": + version: 0.15.6 + resolution: "expo-updates@npm:0.15.6" + dependencies: + "@expo/code-signing-certificates": 0.0.5 + "@expo/config": ~7.0.2 + "@expo/config-plugins": ~5.0.3 + "@expo/metro-config": ~0.5.0 + arg: 4.1.0 + expo-eas-client: ~0.4.0 + expo-manifests: ~0.4.0 + expo-structured-headers: ~3.0.0 + expo-updates-interface: ~0.8.0 + fbemitter: ^3.0.0 + resolve-from: ^5.0.0 + uuid: ^3.4.0 + peerDependencies: + expo: "*" + bin: + expo-updates: bin/cli.js + checksum: 8f9dcdc0b1f096cd20d43242af6df96239a4617c33951ea1453a6b160fc11ce5153c667bcecf89151aae90332bbf8fc93e4d2dbae5a194bf124ecc4f04251541 + languageName: node + linkType: hard + "expo@npm:*, expo@npm:^47.0.0": version: 47.0.11 resolution: "expo@npm:47.0.11" @@ -10186,6 +10224,7 @@ __metadata: expo-router: ^0.0.36 expo-screen-orientation: ~5.0.1 expo-status-bar: ~1.4.2 + expo-updates: ~0.15.6 i18next: ^22.0.6 intl-pluralrules: ^1.3.1 moti: ^0.21.0