From 00a44cc29e49ec83f8c23dc88c5a407d88495340 Mon Sep 17 00:00:00 2001 From: Seth Schroeder Date: Mon, 18 Sep 2023 19:54:50 +0200 Subject: [PATCH] use fastlane variables for github token --- .github/workflows/production.yml | 5 ++--- fastlane/Fastfile | 7 ++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 22dbbb9431..068d8919f3 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -54,8 +54,7 @@ jobs: run: echo "$GOOGLE_PLAY_SERVICE_ACCOUNT" > google-play-service-account.json - name: Build apk with fastlane - run: bundle exec fastlane prod + run: bundle exec fastlane prod github_token:${{ secrets.GITHUB_TOKEN }} env: KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }} - KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }} \ No newline at end of file diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 3dbc375d07..2d492a4516 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -13,7 +13,6 @@ # Uncomment the line if you want fastlane to automatically update itself # update_fastlane -update_fastlane sh("bundle install") default_platform(:android) @@ -24,12 +23,10 @@ lane :testing do end desc "Create and deploy production release" -lane :prod do +lane :prod do |options| version_code = get_properties_value(key: "VERSION_CODE", path: "./app/version.properties") version_name = get_properties_value(key: "VERSION_NAME", path: "./app/version.properties") - github_token = ENV["GITHUB_TOKEN"] - whats_new = File.read("../app/src/main/assets/whats-new.txt") File.write("metadata/android/en-US/changelogs/" + version_code + ".txt", whats_new) @@ -42,7 +39,7 @@ lane :prod do github_release = set_github_release( repository_name: "keymapperorg/KeyMapper", - api_token: github_token, + api_token: options[:github_token], name: version_name, tag_name: "v" + version_name, description: whats_new,