Skip to content

Updating expo to version 52, making text selectable, auto set changelog date #1215

Updating expo to version 52, making text selectable, auto set changelog date

Updating expo to version 52, making text selectable, auto set changelog date #1215

Workflow file for this run

name: "Pipeline"
on:
workflow_dispatch:
push:
paths-ignore:
- ".github/**"
- "docs/**"
- "e2e/**"
- "**/*.test.ts"
- "README.md"
- "License.md"
- ".gitignore"
- ".prettierignore"
- ".prettierrc.json"
branches:
- main
pull_request:
paths-ignore:
- ".github/**"
- "docs/**"
- "README.md"
- "License.md"
- ".gitignore"
- ".prettierignore"
- ".prettierrc.json"
branches:
- main
# https://stackoverflow.com/questions/74117321/if-condition-in-concurrency-in-gha
# A PR will have workflows in the same group, different PRs will have workflows in different groups, and each main workflow will have different group IDs
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
code_scan:
runs-on: ubuntu-latest
steps:
- name: πŸ— Setup repo
uses: actions/checkout@v3
- name: Prettier Check
run: |
npm i [email protected]
npx prettier --check .
- name: Typescript Check
working-directory: sudokuru
run: npx tsc
app_preview_dev:
if: ${{ contains(fromJSON('["pull_request"]'), github.event_name)}}
runs-on: ubuntu-latest
needs: [ code_scan, analyze ]
steps:
- name: πŸ— Setup repo
uses: actions/checkout@v3
- name: πŸ— Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Setup Changelog
uses: ./.github/workflows/composite-actions/set-changelog-date
- name: πŸ— Setup Expo
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: πŸ“¦ Install dependencies
run: npm ci
- name: πŸš€ Publish App preview
uses: expo/expo-github-action/preview@v8
with:
working-directory: sudokuru
command: eas update --branch preview --message "${{ github.event.pull_request.title }}"
- name: Cloudflare dev preview deployment
id: deployment
uses: ./.github/workflows/composite-actions/cloudflare-deployment
with:
project-name: sudokuru-dev
account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- name: Post comment with preview link
uses: KeisukeYamashita/create-comment@v1
with:
check-only-first-line: true
comment: |
Preview Website for PR:
${{ steps.deployment.outputs.url }}
website_test_dev:
runs-on: ubuntu-latest
needs: [ code_scan, analyze ]
steps:
- name: πŸ— Setup repo
uses: actions/checkout@v3
- name: πŸ— Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: install dependencies
run: npm i
- name: Setup Changelog
uses: ./.github/workflows/composite-actions/set-changelog-date
- uses: JarvusInnovations/background-action@v1
name: Bootstrap System Under Test (SUT)
with:
run: npm run web &
wait-on: http://localhost:8081
wait-for: 5m
log-output-if: true
- name: Install Playwright Browsers
run: npm run playwright:init --with-deps
- name: Playwright run
run: npm run playwright:test:chrome
working-directory: e2e/web
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: e2e/web/playwright-report/results.xml
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: PlaywrightTestResults
path: e2e/web/test-results/*
- name: Upload coverage reports to Codecov
if: always()
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# https://github.com/codacy/codacy-coverage-reporter/issues/506
# codacy does not allow uploading of codacy.json files directly without API endpoint
# - name: Run codacy-coverage-reporter
# if: always()
# uses: codacy/[email protected]
# with:
# project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
# coverage-reports: test-results/coverage/codacy.json
app_build_android:
runs-on: ubuntu-latest
needs: [ code_scan, analyze ]
steps:
- name: πŸ— Setup repo
uses: actions/checkout@v3
- name: πŸ— Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Setup Changelog
uses: ./.github/workflows/composite-actions/set-changelog-date
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: πŸ— Setup Expo and EAS
uses: expo/expo-github-action@v8
with:
expo-version: latest
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: πŸ“¦ Install dependencies
run: npm ci
- name: πŸš€ Build app
run: eas build --non-interactive --platform android --local
working-directory: sudokuru
env:
EAS_LOCAL_BUILD_ARTIFACTS_DIR: Build
- name: Upload binary Artifact
uses: actions/upload-artifact@v3
with:
name: android binary
path: sudokuru/Build/*.apk
app_build_desktop:
strategy:
fail-fast: false
matrix:
platform: [ [linux, ubuntu-20.04], [windows, windows-latest] ]
runs-on: ${{ matrix.platform[1] }}
needs: [ code_scan, analyze ]
steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup Changelog
uses: ./.github/workflows/composite-actions/set-changelog-date
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: install ubuntu dependencies
if: matrix.platform[1] == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: install frontend dependencies
run: npm ci
- uses: tauri-apps/tauri-action@v0
id: tauri_build
with:
tauriScript: npm run tauri:run
- name: Upload ${{ matrix.platform[0] }} Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform[0] }} binary
path: "${{ join(fromJSON(steps.tauri_build.outputs.artifactPaths), '\n') }}"
deploy_app_dev:
name: Deploy Dev app to Itch.io
strategy:
fail-fast: false
matrix:
binary_name: [linux, windows, android]
needs: [ app_build_android, website_test_dev, app_build_desktop ]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- name: Download binary Artifact
uses: actions/download-artifact@v3
with:
name: ${{matrix.binary_name}} binary
path: bundle
- name: Install Butler
run: |
curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
unzip butler.zip
chmod +x butler
./butler -V
- name: Update Itch.io ${{matrix.binary_name}} Alpha App
run: ./butler push bundle ${{secrets.ITCH_USERNAME}}/${{secrets.ITCH_GAME_ID}}:alpha-${{matrix.binary_name}}
env:
BUTLER_API_KEY: ${{secrets.BUTLER_API_KEY}}
deploy_app_prod:
name: Deploy Prod app to Itch.io
strategy:
fail-fast: false
matrix:
binary_name: [linux, windows, android]
needs: [ deploy_website_dev, deploy_app_dev ]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- name: Download binary Artifact
uses: actions/download-artifact@v3
with:
name: ${{matrix.binary_name}} binary
path: bundle
- name: Install Butler
run: |
curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
unzip butler.zip
chmod +x butler
./butler -V
- name: Update Itch.io ${{matrix.binary_name}} Prod App
run: ./butler push bundle ${{secrets.ITCH_USERNAME}}/${{secrets.ITCH_GAME_ID}}:stable-${{matrix.binary_name}}
env:
BUTLER_API_KEY: ${{secrets.BUTLER_API_KEY}}
deploy_website_dev:
name: Deploy Dev Website
needs: [ app_build_android, website_test_dev, app_build_desktop ]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- run: npm ci
- name: Setup Changelog
uses: ./.github/workflows/composite-actions/set-changelog-date
- name: Cloudflare dev preview deployment
id: deployment
uses: ./.github/workflows/composite-actions/cloudflare-deployment
with:
project-name: sudokuru-dev
account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
deploy_website_prod:
name: Deploy Prod Website
needs: [ deploy_website_dev, deploy_app_dev ]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- run: npm ci
- name: Setup Changelog
uses: ./.github/workflows/composite-actions/set-changelog-date
- name: Cloudflare dev preview deployment
id: deployment
uses: ./.github/workflows/composite-actions/cloudflare-deployment
with:
project-name: sudokuru
account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}