From c7cf3d52f1a79d4e7ee84f1edbb482a88dc9542c Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Sat, 11 Jun 2022 14:21:39 +0200 Subject: [PATCH] Improve building --- .github/workflows/build.yml | 19 +++++++++++++++---- .nvmrc | 1 + fastlane/Fastfile | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 .nvmrc diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6da46bac..fa5e7b4e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - name: -- Step 2 -- Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version-file: '.nvmrc' - name: -- Step 3 -- Install node dependencies run: yarn install - name: -- Step 4 -- Install ruby dependencies @@ -53,7 +53,7 @@ jobs: - name: -- Step 2 -- Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version-file: '.nvmrc' - name: -- Step 3 -- Setup Java uses: actions/setup-java@v3 with: @@ -74,6 +74,13 @@ jobs: ANDROID_KEYSTORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }} SUPPLY_JSON_KEY_DATA: ${{ secrets.SUPPLY_JSON_KEY_DATA }} run: yarn app:build android + - name: -- Step 7 -- Upload apk + uses: actions/upload-artifact@v3 + with: + name: apk + path: ${{ github.workspace }}/tooot.apk + if-no-files-found: warn + retention-days: 7 create-release: runs-on: ubuntu-latest @@ -88,7 +95,7 @@ jobs: - name: -- Step 2 -- Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version-file: '.nvmrc' - name: -- Step 3 -- Use Expo action uses: expo/expo-github-action@v7 with: @@ -98,7 +105,11 @@ jobs: run: yarn install - name: -- Step 5 -- Install ruby dependencies run: bundle install - - name: -- Step 6 -- Run fastlane + - name: -- Step 6 -- Download apk + uses: actions/download-artifact@v3 + with: + name: apk + - name: -- Step 7 -- Run fastlane env: ENVIRONMENT: ${{ steps.branch.outputs.branch }} LC_ALL: en_US.UTF-8 diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..19c7bdba --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +16 \ No newline at end of file diff --git a/fastlane/Fastfile b/fastlane/Fastfile index fd746971..69f335b6 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -52,7 +52,7 @@ private_lane :github_release do |options| description: "No changelog provided", commitish: git_branch, is_prerelease: options[:prerelease], - upload_assets: ["#{File.expand_path('..', Dir.pwd)}/tooot-#{GITHUB_RELEASE}.apk"] + upload_assets: ["#{File.expand_path('..', Dir.pwd)}/tooot.apk"] ) end @@ -198,7 +198,7 @@ private_lane :build_android do "android.injected.signing.key.password" => ENV["ANDROID_KEYSTORE_KEY_PASSWORD"], } ) - sh "mv #{lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]} #{File.expand_path('..', Dir.pwd)}/tooot-#{GITHUB_RELEASE}.apk" + sh "mv #{lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]} #{File.expand_path('..', Dir.pwd)}/tooot.apk" else if !is_ci build_android_app(