Skip to content

feat: update node version in CI #1267

feat: update node version in CI

feat: update node version in CI #1267

name: Release electron-app && crusher-cli/debug
on:
push:
branches:
- master
- baseBranch
- improve-editing
- update-ea-structure
release:
types: [published]
jobs:
prepare:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-20.04]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.2.2
with:
version: 7.5.1
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16.13.2
cache: 'pnpm'
- name: Create ecosystem.config.js and Copy .env.sample file
run: cp ecosystem.config.sample.js ecosystem.config.js && cp .env.sample .env
- name: Install crusher modules
run: pnpm install --frozen-lockfile --reporter=append-only --ignore-scripts
- name: Setup crusher for prod
run: pnpm setup:prod
- name: Download binaries
run: sh ./scripts/download-binaries.sh
env:
GA_CLIENT_ID: ${{ secrets.GA_CLIENT_ID }}
GA_CLIENT_SECRET: ${{ secrets.GA_CLIENT_SECRET }}
- name: Show binary
run: ls -l packages/electron-app/bin
- name: Throw error if all artifacts are not present (i.e < 3)
run: eval 't=$(ls -1q packages/electron-app/bin | wc -l);' && eval "if [ $t -lt 3 ]; then echo Error All artifacts not present; exit 64; fi"
- name: Update packages/electron-app/package.json versions
run: GITHUB_ACTION_EVENT_NAME=${{ github.event_name }} node ./scripts/update-local-ea-version.js
env:
CRUSHER_GIT_RELEASE_TOKEN: ${{ secrets.CRUSHER_GIT_RELEASE_TOKEN }}
- if: matrix.os == 'ubuntu-20.04'
name: Build release for electron app
run: cd packages/electron-app && BACKEND_URL=https://backend.crusher.dev FRONTEND_URL=https://app.crusher.dev pnpm release
env:
SEGMENT_API_KEY: ${{ secrets.RECORDER_SEGMENT_API_KEY }}
- if: ${{ matrix.os == 'macos-latest' && github.event_name != 'release' }}
name: Build release for electron app
run: cd packages/electron-app && SKIP_NOTARIZATION=true BACKEND_URL=https://backend.crusher.dev FRONTEND_URL=https://app.crusher.dev PUBLISH_RELEASE=always pnpm release
env:
CSC_LINK: ${{ secrets.mac_certs }}
CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
SEGMENT_API_KEY: ${{ secrets.RECORDER_SEGMENT_API_KEY }}
- if: ${{ matrix.os == 'macos-latest' && github.event_name == 'release' }}
name: Build release for electron app
run: cd packages/electron-app && BACKEND_URL=https://backend.crusher.dev FRONTEND_URL=https://app.crusher.dev PUBLISH_RELEASE=always pnpm release
env:
CSC_LINK: ${{ secrets.mac_certs }}
CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
SEGMENT_API_KEY: ${{ secrets.RECORDER_SEGMENT_API_KEY }}
- if: matrix.os == 'macos-latest'
name: 'Store crusher-darwin-arm64 as artifact'
uses: actions/upload-artifact@v2
with:
name: crusher-darwin-arm64.zip
path: output/crusher-electron-app-release/darwin/Crusher.Recorder-*-arm64.zip
retention-days: 5
- if: matrix.os == 'macos-latest'
name: 'Store crusher-darwin-x64 as artifact'
uses: actions/upload-artifact@v2
with:
name: crusher-darwin-x64.zip
path: output/crusher-electron-app-release/darwin/Crusher.Recorder-*-x64.zip
retention-days: 5
- if: matrix.os == 'ubuntu-20.04'
name: 'Store crusher-linux as artifact'
uses: actions/upload-artifact@v2
with:
name: crusher-linux.zip
path: output/crusher-electron-app-release/linux/Crusher.Recorder-*-linux.zip
retention-days: 5
release:
needs: prepare
runs-on: ubuntu-20.04
concurrency: recorder-release
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Show artifact
run: ls -l artifacts
- name: Throw error if all artifacts are not present (i.e < 3)
run: eval 't=$(ls -1q artifacts | wc -l);' && eval "if [ $t -lt 3 ]; then echo Error All artifacts not present; exit 64; fi"
- uses: pnpm/action-setup@v2.2.2
with:
version: 7.5.1
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16.13.2
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Install crusher modules
run: pnpm install --frozen-lockfile --reporter=append-only --ignore-scripts
- name: Run release script
run: GITHUB_ACTION_EVENT_NAME=${{ github.event_name }} node ./scripts/release-debug.js
env:
CRUSHER_GIT_RELEASE_TOKEN: ${{ secrets.CRUSHER_GIT_RELEASE_TOKEN }}
DOWNLOADS_REPO_URL: https://github.com/crusher-dev/crusher-downloads/
SEGMENT_API_KEY: ${{ secrets.SEGMENT_API_KEY }}
- if: github.event_name != 'release'
run: cd output/crusher-cli && npm publish --tag canary
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
- if: github.event_name == 'release'
run: cd output/crusher-cli && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}