3.4.0 #76
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: 'Production Releases' | |
'on': | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
uiTest: | |
name: 'UI Tests' | |
runs-on: 'ubuntu-22.04' | |
steps: | |
- name: 'Mask any potential PII' | |
run: "echo \"::add-mask::${{ secrets.PHONE_NUMBER }}\"\necho \"::add-mask::${{ secrets.APPLE_ID }}\"" | |
- name: 'Checkout the current branch' | |
uses: 'actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11' | |
with: | |
fetch-depth: 0 | |
- name: 'Setup Node.js - 20' | |
uses: 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8' | |
with: | |
node-version: '>=20' | |
cache: 'npm' | |
- uses: 'actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9' | |
name: 'Cache Node Modules' | |
with: | |
path: '~/.npm' | |
key: '${{ runner.os}}-node-${{ hashFiles(''**/package-lock.json'') }}' | |
restore-keys: '${{ runner.os }}-node-' | |
- name: 'Install Gulp' | |
run: 'npm install -g [email protected]' | |
- name: 'Install Node modules' | |
run: 'npm ci' | |
- name: 'Set virtual display if Ubuntu' | |
if: 'runner.os == ''Linux''' | |
run: 'Xvfb :99 &' | |
- name: 'Setup Playwright dependencies' | |
run: 'npx playwright install --with-deps' | |
- name: 'Run UI tests' | |
run: 'gulp uiTests --max-old-space-size=8192' | |
env: | |
DISPLAY: ':99' | |
- name: 'Upload build artifacts if failed' | |
if: 'failure()' | |
uses: 'actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba' | |
with: | |
path: "apps/**/dist/\ndist/" | |
unitTest: | |
name: 'Unit Tests' | |
runs-on: 'ubuntu-22.04' | |
steps: | |
- name: 'Mask any potential PII' | |
run: "echo \"::add-mask::${{ secrets.PHONE_NUMBER }}\"\necho \"::add-mask::${{ secrets.APPLE_ID }}\"" | |
- name: 'Checkout the current branch' | |
uses: 'actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11' | |
with: | |
fetch-depth: 0 | |
- name: 'Setup Node.js - 20' | |
uses: 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8' | |
with: | |
node-version: '>=20' | |
cache: 'npm' | |
- uses: 'actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9' | |
name: 'Cache Node Modules' | |
with: | |
path: '~/.npm' | |
key: '${{ runner.os}}-node-${{ hashFiles(''**/package-lock.json'') }}' | |
restore-keys: '${{ runner.os }}-node-' | |
- name: 'Install Gulp' | |
run: 'npm install -g [email protected]' | |
- name: 'Install Node modules' | |
run: 'npm ci' | |
- name: 'Set virtual display if Ubuntu' | |
if: 'runner.os == ''Linux''' | |
run: 'Xvfb :99 &' | |
- name: 'Setup Playwright dependencies' | |
run: 'npx playwright install --with-deps' | |
- name: 'Run unit tests' | |
run: 'gulp unitTests --max-old-space-size=8192' | |
deployWeb: | |
name: 'Deploy Web to lyricistant.app' | |
runs-on: 'ubuntu-22.04' | |
needs: | |
- 'uiTest' | |
- 'unitTest' | |
if: '${{ contains(github.ref, ''web'') || endsWith(github.ref, ''0'') || endsWith(github.ref, ''1'') || endsWith(github.ref, ''2'') || endsWith(github.ref, ''3'') || endsWith(github.ref, ''4'') || endsWith(github.ref, ''5'') || endsWith(github.ref, ''6'') || endsWith(github.ref, ''7'') || endsWith(github.ref, ''8'') || endsWith(github.ref, ''9'') }}' | |
steps: | |
- name: 'Mask any potential PII' | |
run: "echo \"::add-mask::${{ secrets.PHONE_NUMBER }}\"\necho \"::add-mask::${{ secrets.APPLE_ID }}\"" | |
- name: 'Checkout the current branch' | |
uses: 'actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11' | |
with: | |
fetch-depth: 0 | |
- name: 'Setup Node.js - 20' | |
uses: 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8' | |
with: | |
node-version: '>=20' | |
cache: 'npm' | |
- uses: 'actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9' | |
name: 'Cache Node Modules' | |
with: | |
path: '~/.npm' | |
key: '${{ runner.os}}-node-${{ hashFiles(''**/package-lock.json'') }}' | |
restore-keys: '${{ runner.os }}-node-' | |
- name: 'Install Gulp' | |
run: 'npm install -g [email protected]' | |
- name: 'Install Node modules' | |
run: 'npm ci' | |
- name: 'Build Web' | |
run: 'gulp buildWeb --max-old-space-size=8192' | |
- name: 'Deploy Web' | |
uses: 'peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e' | |
with: | |
personal_token: '${{ secrets.LYRICISTANT_TOKEN }}' | |
publish_branch: 'gh-pages' | |
publish_dir: 'apps/web/dist/production/' | |
force_orphan: true | |
cname: 'lyricistant.app' | |
external_repository: 'wardellbagby/lyricistant-website' | |
buildIOSApp: | |
name: 'Build iOS' | |
runs-on: 'macos-13' | |
steps: | |
- name: 'Mask any potential PII' | |
run: "echo \"::add-mask::${{ secrets.PHONE_NUMBER }}\"\necho \"::add-mask::${{ secrets.APPLE_ID }}\"" | |
- name: 'Checkout the current branch' | |
uses: 'actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11' | |
with: | |
fetch-depth: 0 | |
- name: 'Setup Node.js - 20' | |
uses: 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8' | |
with: | |
node-version: '>=20' | |
cache: 'npm' | |
- uses: 'actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9' | |
name: 'Cache Node Modules' | |
with: | |
path: '~/.npm' | |
key: '${{ runner.os}}-node-${{ hashFiles(''**/package-lock.json'') }}' | |
restore-keys: '${{ runner.os }}-node-' | |
- name: 'Install Gulp' | |
run: 'npm install -g [email protected]' | |
- name: 'Setup Ruby' | |
uses: 'ruby/setup-ruby@6bd3d993c602f6b675728ebaecb2b569ff86e99b' | |
with: | |
bundler-cache: true | |
- name: 'Setup Java 17' | |
uses: 'actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9' | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
- name: 'Install Fastlane' | |
run: 'gem install bundler && bundle install' | |
- name: 'Install Node modules' | |
run: 'npm ci' | |
- name: 'Create App Store Connect credentials' | |
run: 'echo "${{ secrets.APP_STORE_CONNECT_KEY }}" | base64 --decode > apps/mobile/ios/authkey.p8' | |
- name: 'Bundle Mobile' | |
run: 'gulp bundleIOS --max-old-space-size=8192' | |
env: | |
NIGHTLY: false | |
- name: 'Create iOS release notes' | |
run: './scripts/create_release_changelog.ts ios fastlane/metadata/ios/en-US/release_notes.txt' | |
- name: 'Build iOS' | |
run: 'bundle exec fastlane ios release deploy:true' | |
env: | |
APP_STORE_KEY_ID: '${{ secrets.APP_STORE_KEY_ID }}' | |
APP_STORE_ISSUER_ID: '${{ secrets.APP_STORE_ISSUER_ID }}' | |
FIRST_NAME: 'Wardell' | |
LAST_NAME: 'Bagby' | |
PHONE: '${{ secrets.PHONE }}' | |
EMAIL: '${{ secrets.APPLE_ID }}' | |
MATCH_GIT_BASIC_AUTHORIZATION: '${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}' | |
MATCH_PASSWORD: '${{ secrets.MATCH_PASSWORD }}' | |
- name: 'Upload iOS app' | |
uses: 'actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba' | |
with: | |
name: 'ios-app' | |
path: 'apps/mobile/dist/ios/*.ipa' | |
needs: | |
- 'uiTest' | |
- 'unitTest' | |
if: '${{ contains(github.ref, ''ios'') || endsWith(github.ref, ''0'') || endsWith(github.ref, ''1'') || endsWith(github.ref, ''2'') || endsWith(github.ref, ''3'') || endsWith(github.ref, ''4'') || endsWith(github.ref, ''5'') || endsWith(github.ref, ''6'') || endsWith(github.ref, ''7'') || endsWith(github.ref, ''8'') || endsWith(github.ref, ''9'') }}' | |
buildAndroidApp: | |
name: 'Build Android' | |
runs-on: 'ubuntu-22.04' | |
steps: | |
- name: 'Mask any potential PII' | |
run: "echo \"::add-mask::${{ secrets.PHONE_NUMBER }}\"\necho \"::add-mask::${{ secrets.APPLE_ID }}\"" | |
- name: 'Checkout the current branch' | |
uses: 'actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11' | |
with: | |
fetch-depth: 0 | |
- name: 'Setup Node.js - 20' | |
uses: 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8' | |
with: | |
node-version: '>=20' | |
cache: 'npm' | |
- uses: 'actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9' | |
name: 'Cache Node Modules' | |
with: | |
path: '~/.npm' | |
key: '${{ runner.os}}-node-${{ hashFiles(''**/package-lock.json'') }}' | |
restore-keys: '${{ runner.os }}-node-' | |
- name: 'Install Gulp' | |
run: 'npm install -g [email protected]' | |
- name: 'Setup Ruby' | |
uses: 'ruby/setup-ruby@6bd3d993c602f6b675728ebaecb2b569ff86e99b' | |
with: | |
bundler-cache: true | |
- name: 'Setup Java 17' | |
uses: 'actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9' | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
- name: 'Install Fastlane' | |
run: 'gem install bundler && bundle install' | |
- name: 'Install Node modules' | |
run: 'npm ci' | |
- name: 'Populate keystore' | |
run: 'echo "${{ secrets.KEYSTORE }}" | base64 --decode > apps/mobile/android/android.keystore' | |
- name: 'Populate keystore properties' | |
run: 'echo "${{ secrets.KEYSTORE_PROPERTIES }}" | base64 --decode > apps/mobile/android/keystore.properties' | |
- name: 'Populate Play Store credentials' | |
run: 'echo "${{ secrets.PLAY_STORE_CREDS }}" | base64 --decode > play-store-credentials.json' | |
- name: 'Bundle Mobile' | |
run: 'gulp bundleAndroid --max-old-space-size=8192' | |
env: | |
NIGHTLY: false | |
- name: 'Create Android release notes' | |
run: './scripts/create_release_changelog.ts android fastlane/metadata/android/en-US/changelogs/default.txt' | |
- name: 'Build Android' | |
run: 'bundle exec fastlane android release deploy:true' | |
- name: 'Upload Android app' | |
uses: 'actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba' | |
with: | |
name: 'android-app' | |
path: 'apps/mobile/dist/android/*.apk' | |
needs: | |
- 'uiTest' | |
- 'unitTest' | |
if: '${{ contains(github.ref, ''android'') || endsWith(github.ref, ''0'') || endsWith(github.ref, ''1'') || endsWith(github.ref, ''2'') || endsWith(github.ref, ''3'') || endsWith(github.ref, ''4'') || endsWith(github.ref, ''5'') || endsWith(github.ref, ''6'') || endsWith(github.ref, ''7'') || endsWith(github.ref, ''8'') || endsWith(github.ref, ''9'') }}' | |
buildElectronApps: | |
name: 'Build Electron Apps' | |
runs-on: 'macos-13' | |
steps: | |
- name: 'Mask any potential PII' | |
run: "echo \"::add-mask::${{ secrets.PHONE_NUMBER }}\"\necho \"::add-mask::${{ secrets.APPLE_ID }}\"" | |
- name: 'Checkout the current branch' | |
uses: 'actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11' | |
with: | |
fetch-depth: 0 | |
- name: 'Setup Node.js - 20' | |
uses: 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8' | |
with: | |
node-version: '>=20' | |
cache: 'npm' | |
- uses: 'actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9' | |
name: 'Cache Node Modules' | |
with: | |
path: '~/.npm' | |
key: '${{ runner.os}}-node-${{ hashFiles(''**/package-lock.json'') }}' | |
restore-keys: '${{ runner.os }}-node-' | |
- name: 'Install Gulp' | |
run: 'npm install -g [email protected]' | |
- name: 'Install Node modules' | |
run: 'npm ci' | |
- name: 'Build Electron apps' | |
uses: 'nick-invision/retry@7152eba30c6575329ac0576536151aca5a72780e' | |
env: | |
CSC_LINK: '${{ secrets.MACOS_CERT }}' | |
CSC_KEY_PASSWORD: '${{ secrets.MACOS_CERT_PASSWORD }}' | |
APPLE_ID: '${{ secrets.APPLE_ID }}' | |
APPLE_ID_PASSWORD: '${{ secrets.APPLE_ID_PASSWORD }}' | |
NIGHTLY: false | |
with: | |
timeout_minutes: 60 | |
max_attempts: 3 | |
command: 'gulp buildAllElectronApps --max-old-space-size=8192' | |
- name: 'Upload Electron apps' | |
uses: 'actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba' | |
with: | |
name: 'electron-apps' | |
path: 'apps/electron/dist/production/app/*.*' | |
needs: | |
- 'uiTest' | |
- 'unitTest' | |
if: '${{ contains(github.ref, ''electron'') || endsWith(github.ref, ''0'') || endsWith(github.ref, ''1'') || endsWith(github.ref, ''2'') || endsWith(github.ref, ''3'') || endsWith(github.ref, ''4'') || endsWith(github.ref, ''5'') || endsWith(github.ref, ''6'') || endsWith(github.ref, ''7'') || endsWith(github.ref, ''8'') || endsWith(github.ref, ''9'') }}' | |
createGithubRelease: | |
name: 'Create Github Release' | |
runs-on: 'ubuntu-22.04' | |
if: 'always()' | |
needs: | |
- 'buildIOSApp' | |
- 'buildElectronApps' | |
- 'buildAndroidApp' | |
steps: | |
- name: 'Mask any potential PII' | |
run: "echo \"::add-mask::${{ secrets.PHONE_NUMBER }}\"\necho \"::add-mask::${{ secrets.APPLE_ID }}\"" | |
- name: 'Checkout the current branch' | |
uses: 'actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11' | |
with: | |
fetch-depth: 0 | |
- name: 'Setup Node.js - 20' | |
uses: 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8' | |
with: | |
node-version: '>=20' | |
cache: 'npm' | |
- uses: 'actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9' | |
name: 'Cache Node Modules' | |
with: | |
path: '~/.npm' | |
key: '${{ runner.os}}-node-${{ hashFiles(''**/package-lock.json'') }}' | |
restore-keys: '${{ runner.os }}-node-' | |
- name: 'Install Gulp' | |
run: 'npm install -g [email protected]' | |
- name: 'Install Node modules' | |
run: 'npm ci' | |
- name: 'Create Github release notes' | |
run: './scripts/create_release_changelog.ts all release.txt' | |
- name: 'Download iOS app' | |
uses: 'actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d' | |
with: | |
name: 'ios-app' | |
path: '/tmp/artifacts' | |
if: 'needs.buildIOSApp.result == ''success''' | |
- name: 'Download Electron apps' | |
uses: 'actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d' | |
with: | |
name: 'electron-apps' | |
path: '/tmp/artifacts' | |
if: 'needs.buildElectronApps.result == ''success''' | |
- name: 'Download Android app' | |
uses: 'actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d' | |
with: | |
name: 'android-app' | |
path: '/tmp/artifacts' | |
if: 'needs.buildAndroidApp.result == ''success''' | |
- name: 'Create Github release' | |
uses: 'softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564' | |
with: | |
token: '${{ secrets.GITHUB_TOKEN }}' | |
body_path: 'release.txt' | |
files: '/tmp/artifacts/*.*' | |
prerelease: false | |
if: '${{ needs.buildIOSApp.result == ''success'' || needs.buildElectronApps.result == ''success'' || needs.buildAndroidApp.result == ''success'' }}' |