Packaging #146
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: Packaging | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- package | |
tags: | |
- '*' | |
env: | |
FORCE_COLOR: 1 | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- macos-13 | |
host: | |
- x64 | |
target: | |
- x64 | |
node: | |
- 22 | |
name: ${{ matrix.os }} (node=${{ matrix.node }}, host=${{ matrix.host }}, target=${{ matrix.target }}) | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Submodule cleanup fix # See https://github.com/actions/checkout/issues/358 | |
run: | | |
git submodule foreach --recursive git clean -ffdx | |
git submodule foreach --recursive git reset --hard | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- uses: actions/cache@v4 | |
id: yarn-cache | |
with: | |
path: | | |
node_modules | |
core/node_modules | |
key: ${{ matrix.os }}-${{ matrix.target }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ matrix.os }}-${{ matrix.target }}-yarn- | |
- name: Install dependencies | |
if: steps.yarn-cache.outputs.cache-hit != 'true' | |
run: yarn install --network-timeout 300000 | |
# - name: Fix Windows x86 sqlite3 binding | |
# if: steps.yarn-cache.outputs.cache-hit != 'true' && startsWith(matrix.os, 'windows') && matrix.target == 'x86' | |
# run: yarn upgrade sqlite3 | |
# # Prebuilt binding is for x64. We must build from source for x86 target. | |
# # See: | |
# # https://stackoverflow.com/questions/72553650/how-to-get-node-sqlite3-working-on-mac-m1 | |
# # https://yarnpkg.com/lang/en/docs/envvars/#toc-npm-config | |
# env: | |
# npm_config_build_from_source: true | |
# npm_config_target_arch: ia32 | |
# npm_config_fallback_to_build: true | |
- name: Hooks and crooks | |
run: yarn run setup | |
env: | |
RUN_OS: ${{ matrix.os }} | |
RUN_ARCH: ${{ matrix.target }} | |
- name: Build | |
run: yarn run build | |
- name: Test | |
run: yarn run test | |
- name: Package | |
# github endpoints hang up quite a bit, add one retry. | |
run: yarn run electron:ci || yarn run electron:ci | |
env: | |
TARGET_ARCH: ${{ matrix.target }} | |
GITHUB_TOKEN: ${{ github.token }} | |
DEBUG: electron-builder | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} | |
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | |
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | |
CSC_LINK: ${{ secrets.CSC_LINK }} | |
- name: Upload macOS build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos-${{ matrix.target }} | |
path: dist/grist-desktop-*.dmg | |
if-no-files-found: "error" |