1515# Based on the ANDROID and IOS inputs, we trigger the build for the corresponding platform with the corresponding flags.
1616
1717# 🚨 GITHUB SECRETS REQUIRED:
18- # - EXPO_TOKEN: Expo token to authenticate with EAS
19- # - You can get it from https://expo.dev/settings/access-tokens
20-
18+ # - EXPO_TOKEN: Expo token to authenticate with EAS to sync version numbers and submit the build.
19+ # You can get it from https://expo.dev/settings/access-tokens
20+ # - NEW_VERSION_NUMBER_PAT: A fine-grained Personal Access Token.
21+ # This token is used to commit and push to protected branches.
22+ # You can generate one from here: https://github.com/settings/tokens?type=beta
23+ # Set the token name to something meaningful, e.g. "New version number PAT for <Project name>".
24+ # Set the Repository access to "Only select repositories" and select this repository.
25+ # Set the following Repo permissions:
26+ # - Contents: Read & write (to commit and push)
27+ # Make sure to add it to the repo secrets with the name NEW_VERSION_NUMBER_PAT:
28+ # - Go to Repository Settings > Secrets and variables > Actions > New repository secret
29+ # - Name: NEW_VERSION_NUMBER_PAT
30+ # - Value: The Personal Access Token you created
2131name : ' EAS Build (Android & IOS) (EAS)'
2232
2333on :
5060jobs :
5161 Build :
5262 runs-on : ${{ matrix.os }}
63+ permissions :
64+ contents : write
5365 environment : app-${{ inputs.environment }}
5466 strategy :
5567 fail-fast : false
6173 - platform : android
6274 os : ubuntu-latest
6375 steps :
76+ - name : Check if Personal Access Token exists
77+ env :
78+ PAT : ${{ secrets.NEW_VERSION_NUMBER_PAT }}
79+ if : env.PAT == ''
80+ run : |
81+ echo "NEW_VERSION_NUMBER_PAT secret not found. Please create a fine-grained Personal Access Token following the instructions in the workflow file."
82+ exit 1
83+
6484 - name : Check for EXPO_TOKEN
6585 run : |
6686 if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
7898 uses : actions/checkout@v3
7999 with :
80100 fetch-depth : 0
101+ token : ${{ secrets.NEW_VERSION_NUMBER_PAT }}
81102
82103 - name : 📦 Setup Node + PNPM + install deps
83104 uses : ./.github/actions/setup-node-pnpm-install
@@ -88,13 +109,15 @@ jobs:
88109 - name : Update version in package.json
89110 if : inputs.new-version
90111 run : |
91- pnpm version ${{ inputs.new-version }}
112+ git config --global user.name "github-actions[bot]"
113+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
114+ pnpm version ${{ inputs.new-version }} -m "chore: set app version to ${{ inputs.new-version }}"
92115
93- - name : ⚙️ Run Prebuild
94- run : pnpm prebuild:${{ inputs.environment }}
116+ # - name: ⚙️ Run Prebuild
117+ # run: pnpm prebuild:${{ inputs.environment }}
95118
96- - name : 📱 Run Build for ${{ matrix.platform }}
97- run : pnpm build:${{ inputs.environment }}:${{ matrix.platform }} --non-interactive --no-wait --message "Build ${{ inputs.environment }} for ${{ matrix.platform }}" --local
119+ # - name: 📱 Run Build for ${{ matrix.platform }}
120+ # run: pnpm build:${{ inputs.environment }}:${{ matrix.platform }} --non-interactive --no-wait --message "Build ${{ inputs.environment }} for ${{ matrix.platform }}" --local
98121
99122 - name : 📦 Push changes to repository
100123 if : inputs.new-version
0 commit comments