From 5dab99c173a9769e1004898e61eed9192b5a41b2 Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Mon, 23 Aug 2021 22:07:37 +0900 Subject: [PATCH 01/10] test actions --- .github/workflows/build.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..e1281b8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,17 @@ +name: build +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v2 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." From e391069c814af4a55f3be15cff51e238c747803d Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Mon, 23 Aug 2021 22:26:06 +0900 Subject: [PATCH 02/10] test yarn --- .github/workflows/build.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1281b8..e8be6c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,14 +4,13 @@ jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v2 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14' + cache: 'yarn' + - run: | + yarn - name: List files in the repository run: | ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." From d25e723d07e783ecc1589a4b96fb3bfd89a2e163 Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Mon, 23 Aug 2021 22:36:18 +0900 Subject: [PATCH 03/10] test gradle build/artifact --- .github/workflows/build.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8be6c3..df9f73e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,9 @@ jobs: cache: 'yarn' - run: | yarn - - name: List files in the repository - run: | - ls ${{ github.workspace }} + - run: | + ./android/gradlew -p android assembleRelease -PsignReleaseWithDebug=true + - uses: actions/upload-artifact@v2 + with: + name: app-release.apk + path: android/app/build/outputs/apk/release/app-release.apk From 5166511ca214e678d3b373f0e7f1b36411972467 Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Tue, 24 Aug 2021 09:27:00 +0900 Subject: [PATCH 04/10] test gradle validation/caching --- .github/workflows/build.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index df9f73e..d728fbe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: build on: [push] jobs: - Explore-GitHub-Actions: + build-release-debugsign: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -11,8 +11,14 @@ jobs: cache: 'yarn' - run: | yarn - - run: | - ./android/gradlew -p android assembleRelease -PsignReleaseWithDebug=true + - uses: gradle/wrapper-validation-action@v1 + - uses: gradle/gradle-build-action@v1 + with: + distributions-cache-enabled: true + dependencies-cache-enabled: true + configuration-cache-enabled: true + build-root-directory: android + arguments: assembleRelease -PsignReleaseWithDebug=true - uses: actions/upload-artifact@v2 with: name: app-release.apk From b023b7c8065a524d521736f0a34410cb783242bc Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Tue, 24 Aug 2021 09:38:04 +0900 Subject: [PATCH 05/10] test caching --- app/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/App.tsx b/app/App.tsx index c1f2580..c002262 100644 --- a/app/App.tsx +++ b/app/App.tsx @@ -30,7 +30,7 @@ const App = () => ( const styles = StyleSheet.create({ appContainer: { flex: 1, - backgroundColor: colors.gradient.high, + backgroundColor: 'green', // change test }, }) From 15429133d89923f55d763713d94c5e9435b8ce13 Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Tue, 24 Aug 2021 09:54:34 +0900 Subject: [PATCH 06/10] revert cache test change --- app/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/App.tsx b/app/App.tsx index c002262..c1f2580 100644 --- a/app/App.tsx +++ b/app/App.tsx @@ -30,7 +30,7 @@ const App = () => ( const styles = StyleSheet.create({ appContainer: { flex: 1, - backgroundColor: 'green', // change test + backgroundColor: colors.gradient.high, }, }) From 45b2039effacdaa783e34e6fa19e722ce9f5adb2 Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Tue, 24 Aug 2021 10:54:18 +0900 Subject: [PATCH 07/10] test release signing w/secrets --- ...{build.yml => build-release-debugsign.yml} | 15 ++++-- .github/workflows/build-release.yml | 51 +++++++++++++++++++ 2 files changed, 63 insertions(+), 3 deletions(-) rename .github/workflows/{build.yml => build-release-debugsign.yml} (83%) create mode 100644 .github/workflows/build-release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build-release-debugsign.yml similarity index 83% rename from .github/workflows/build.yml rename to .github/workflows/build-release-debugsign.yml index d728fbe..424ce4b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build-release-debugsign.yml @@ -1,7 +1,16 @@ -name: build -on: [push] +name: build-release-debugsign + +on: + push: + branches: + - master + - release/* + pull_request: + branches: + - master + jobs: - build-release-debugsign: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 0000000..34f5520 --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,51 @@ +name: build-release + +on: push +# on: +# push: +# tags: +# - v* + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14' + cache: 'yarn' + - run: | + yarn + - uses: gradle/wrapper-validation-action@v1 + - name: Retrieve keystore file + env: + SUBTRACKS_KEYSTORE_BASE64: ${{ secrets.SUBTRACKS_KEYSTORE_BASE64 }} + - run: | + echo "$SUBTRACKS_KEYSTORE_BASE64" | base64 --decode android/app/subtracks.keystore + - name: Retrieve keystore secrets + env: + SUBTRACKS_UPLOAD_KEY_PASSWORD: ${{ secrets.SUBTRACKS_UPLOAD_KEY_PASSWORD }} + SUBTRACKS_UPLOAD_STORE_PASSWORD: ${{ secrets.SUBTRACKS_UPLOAD_STORE_PASSWORD }} + - run: > + ./android/gradlew assembleRelease + -p android + -PSUBTRACKS_UPLOAD_STORE_FILE=subtracks.keystore + -PSUBTRACKS_UPLOAD_KEY_ALIAS=subtracks + -PSUBTRACKS_UPLOAD_KEY_PASSWORD="$SUBTRACKS_UPLOAD_KEY_PASSWORD" + -PSUBTRACKS_UPLOAD_STORE_PASSWORD="$SUBTRACKS_UPLOAD_STORE_PASSWORD" + - uses: actions/upload-artifact@v2 + with: + name: app-release.apk + path: android/app/build/outputs/apk/release/app-release.apk + - run: > + ./android/gradlew bundleRelease + -p android + -PSUBTRACKS_UPLOAD_STORE_FILE=subtracks.keystore + -PSUBTRACKS_UPLOAD_KEY_ALIAS=subtracks + -PSUBTRACKS_UPLOAD_KEY_PASSWORD="$SUBTRACKS_UPLOAD_KEY_PASSWORD" + -PSUBTRACKS_UPLOAD_STORE_PASSWORD="$SUBTRACKS_UPLOAD_STORE_PASSWORD" + - uses: actions/upload-artifact@v2 + with: + name: app-release.aab + path: android/app/build/outputs/bundle/release/app-release.aab From 28b05cb4131a8ba6a01b1086cf866fd631b8ff87 Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Tue, 24 Aug 2021 10:57:41 +0900 Subject: [PATCH 08/10] fix run syntax --- .github/workflows/build-release.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 34f5520..612bd1b 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -21,13 +21,13 @@ jobs: - name: Retrieve keystore file env: SUBTRACKS_KEYSTORE_BASE64: ${{ secrets.SUBTRACKS_KEYSTORE_BASE64 }} - - run: | + run: | echo "$SUBTRACKS_KEYSTORE_BASE64" | base64 --decode android/app/subtracks.keystore - - name: Retrieve keystore secrets + - name: Build release APK env: SUBTRACKS_UPLOAD_KEY_PASSWORD: ${{ secrets.SUBTRACKS_UPLOAD_KEY_PASSWORD }} SUBTRACKS_UPLOAD_STORE_PASSWORD: ${{ secrets.SUBTRACKS_UPLOAD_STORE_PASSWORD }} - - run: > + run: > ./android/gradlew assembleRelease -p android -PSUBTRACKS_UPLOAD_STORE_FILE=subtracks.keystore @@ -38,7 +38,11 @@ jobs: with: name: app-release.apk path: android/app/build/outputs/apk/release/app-release.apk - - run: > + - name: Build release AAB + env: + SUBTRACKS_UPLOAD_KEY_PASSWORD: ${{ secrets.SUBTRACKS_UPLOAD_KEY_PASSWORD }} + SUBTRACKS_UPLOAD_STORE_PASSWORD: ${{ secrets.SUBTRACKS_UPLOAD_STORE_PASSWORD }} + run: > ./android/gradlew bundleRelease -p android -PSUBTRACKS_UPLOAD_STORE_FILE=subtracks.keystore From 13e4321d8b49d78a583220b8892f4ffad1dd103b Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Tue, 24 Aug 2021 10:59:02 +0900 Subject: [PATCH 09/10] missed a character --- .github/workflows/build-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 612bd1b..6334c77 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -22,7 +22,7 @@ jobs: env: SUBTRACKS_KEYSTORE_BASE64: ${{ secrets.SUBTRACKS_KEYSTORE_BASE64 }} run: | - echo "$SUBTRACKS_KEYSTORE_BASE64" | base64 --decode android/app/subtracks.keystore + echo "$SUBTRACKS_KEYSTORE_BASE64" | base64 --decode > android/app/subtracks.keystore - name: Build release APK env: SUBTRACKS_UPLOAD_KEY_PASSWORD: ${{ secrets.SUBTRACKS_UPLOAD_KEY_PASSWORD }} From d59d473be675dc02b550d24a8410313306d7d68c Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Tue, 24 Aug 2021 11:13:03 +0900 Subject: [PATCH 10/10] looks to be working, set to only release tags --- .github/workflows/build-release.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 6334c77..c831b97 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -1,10 +1,9 @@ name: build-release -on: push -# on: -# push: -# tags: -# - v* +on: + push: + tags: + - v* jobs: build: