This repository has been archived by the owner on Aug 6, 2024. It is now read-only.
chore: update eas-cli (for build step) [SGW-3617] #2656
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Branch Preview | |
on: [pull_request] | |
# Ensure only a single job or workflow using the same concurrency group will run at a time | |
# When a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, | |
# the queued job or workflow will be pending. | |
concurrency: | |
group: ${{ github.ref }}-deploy-branch-preview # The branch or tag ref that triggered the workflow run. | |
jobs: | |
pr_title_lint: | |
name: PR Title Lint | |
runs-on: ubuntu-latest | |
continue-on-error: false | |
timeout-minutes: 5 | |
steps: | |
- name: check if PR title follows conventional commits specs | |
uses: amannn/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} | |
# using github token for external/dependabot PR, | |
# personal access tokens in secrets will not be accessible in | |
# pipeline for external user PRs | |
markdown_lint: | |
name: Markdown Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16.x | |
- name: Install Packages | |
run: | | |
npm config set //npm.pkg.github.com/:_authToken $NPM_TOKEN | |
npm ci | |
env: | |
NPM_TOKEN: ${{ secrets.GH_TOKEN_SUPPLYALLY_BOT }} | |
- name: Check Markdown Lint | |
run: npm run markdown:lint | |
test: | |
name: Lint & Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16.x | |
- name: Cache Node Modules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install Packages | |
run: | | |
npm config set //npm.pkg.github.com/:_authToken $NPM_TOKEN | |
npm ci --legacy-peer-deps | |
env: | |
NPM_TOKEN: ${{ secrets.GH_TOKEN_SUPPLYALLY_BOT }} | |
- name: Typecheck | |
run: npx --no-install tsc --noEmit | |
- name: Check Lint | |
run: npm run lint | |
- name: Set Timezone to +8 (Ubuntu) | |
run: sudo timedatectl set-timezone Asia/Singapore | |
- name: Test | |
run: npm run test -- --coverage | |
env: | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
APP_BUILD_VERSION: ${{ github.run_number }} | |
APP_BINARY_VERSION: "dev" | |
DOMAIN_FORMAT: ${{ secrets.TEST_DOMAIN_FORMAT }} | |
PROJECT_ID: ${{ secrets.EXPO_TEST_PROJECT_ID }} | |
OWNER: ${{ secrets.EXPO_TEST_OWNER }} | |
deploy_branch_preview: | |
name: Deploy Branch Preview | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Fetch Tags | |
run: | | |
git fetch --prune --unshallow --tags -f | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16.x | |
- uses: expo/expo-github-action@v8 | |
with: | |
eas-version: 3.12.0 | |
expo-version: 6.3.9 | |
packager: npm | |
token: ${{ secrets.EXPO_TOKEN }} | |
eas-cache: true | |
expo-cache: true | |
- name: Cache Node Modules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install Packages | |
run: | | |
npm config set //npm.pkg.github.com/:_authToken $NPM_TOKEN | |
npm ci --legacy-peer-deps | |
env: | |
NPM_TOKEN: ${{ secrets.GH_TOKEN_SUPPLYALLY_BOT }} | |
- name: Get Latest Binary Version # Binary Version will be x.x.x based on the latest tag | |
run: | | |
# Release tag finds the latest tag in the tree branch - i.e. prod-x.x.x | |
RELEASE_TAG=$(echo $(git describe --tags --abbrev=0)) | |
# Using param substitution, we output x.x.x instead | |
echo "LATEST_BINARY_VERSION=${RELEASE_TAG#*-}" >> "$GITHUB_ENV" | |
- name: Echo Version Details | |
run: | | |
echo Build number is $GITHUB_RUN_NUMBER | |
echo Latest release is ${{ env.LATEST_BINARY_VERSION }} | |
- name: Get commit message | |
run: | | |
MSG=$(git log --format=%B -n 1 ${{github.event.after}}) | |
echo "COMMIT_MESSAGE=${MSG}" >> "$GITHUB_ENV" | |
- name: Eas Update Channel | |
env: | |
NODE_OPTIONS: --max_old_space_size=7168 | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
APP_BUILD_VERSION: ${{ github.run_number }} | |
APP_BINARY_VERSION: ${{ env.LATEST_BINARY_VERSION}} | |
DOMAIN_FORMAT: ${{ secrets.TEST_DOMAIN_FORMAT }} | |
PROJECT_ID: ${{ secrets.EXPO_TEST_PROJECT_ID }} | |
OWNER: ${{ secrets.EXPO_TEST_OWNER }} | |
run: | | |
.github/scripts/inject-token.sh | |
eas update --non-interactive --branch pr${{ github.event.number }} --message "${{ env.COMMIT_MESSAGE }}" | |
- name: Preview Deep Link | |
run: echo "APPLICATION_URL=https://u.expo.dev/${{ secrets.EXPO_TEST_PROJECT_ID }}?channel-name=pr${{ github.event.number }}" >> "$GITHUB_ENV" | |
- name: Eas Update Storybook Channel | |
env: | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
APP_BUILD_VERSION: ${{ github.run_number }} | |
APP_BINARY_VERSION: ${{ env.LATEST_BINARY_VERSION }} | |
DOMAIN_FORMAT: ${{ secrets.TEST_DOMAIN_FORMAT }} | |
PROJECT_ID: ${{ secrets.EXPO_TEST_PROJECT_ID }} | |
OWNER: ${{ secrets.EXPO_TEST_OWNER }} | |
START_STORYBOOK: "true" | |
run: | | |
.github/scripts/inject-token.sh | |
eas update --non-interactive --branch storybook-pr${{ github.event.number }} --message "${{ env.COMMIT_MESSAGE }}" | |
- name: Preview Storybook Deep Link | |
run: echo "STORYBOOK_URL=https://u.expo.dev/${{ secrets.EXPO_TEST_PROJECT_ID }}?channel-name=storybook-pr${{ github.event.number }}" >> "$GITHUB_ENV" | |
- name: Add Comment To PR | |
uses: mshick/add-pr-comment@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_SUPPLYALLY_BOT }} | |
with: | |
message: | | |
## Application | |
![Expo QR](https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=exp%2Brationally://expo-development-client/?url=${{ env.APPLICATION_URL }}) | |
OR Enter this link into your dev client: `exp+rationally://expo-development-client/?url=${{ env.APPLICATION_URL }}` | |
## Storybook | |
![Expo QR](https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=exp%2Brationally://expo-development-client/?url=${{ env.STORYBOOK_URL }}) | |
OR Enter this link into your dev client: `exp+rationally://expo-development-client/?url=${{ env.STORYBOOK_URL }}` |