publish #841
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: Mac Build | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- '.github/test-build.yaml' | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: ./ | |
env: | |
USE_HARD_LINKS: false | |
MIGRATIONS_DIR: /tmp/.migrate | |
ASSET_PREFIX: '.' | |
npm_config_yes: true | |
NEXT_PUBLIC_ENGINES: 1 | |
MIGRATIONS_ID_TYPE_SQL: bigint | |
MIGRATIONS_ID_TYPE_GQL: bigint | |
MIGRATIONS_HASURA_PATH: localhost:8080 | |
MIGRATIONS_HASURA_SSL: 0 | |
MIGRATIONS_HASURA_SECRET: myadminsecretkey | |
NEXT_PUBLIC_DEEPLINKS_SERVER: http://localhost:3007 | |
NEXT_PUBLIC_GQL_PATH: localhost:3006/gql | |
NEXT_PUBLIC_GQL_SSL: 0 | |
DEEPLINKS_HASURA_PATH: localhost:8080 | |
DEEPLINKS_HASURA_SSL: 0 | |
MIGRATIONS_DEEPLINKS_APP_URL: http://host.docker.internal:3007 | |
MIGRATIONS_DEEPLINKS_URL: http://host.docker.internal:3006 | |
DOCKER: 1 | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Reconfigure git to use HTTP authentication | |
run: > | |
git config --global url."https://github.com/".insteadOf | |
ssh://[email protected]/ | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 18 | |
- name: Configure Node caching | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-mac | |
with: | |
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 latest npm | |
run: npm i -g npm@latest | |
- name: Install dc dependencies | |
run: npm ci --force | |
- name: Install electron dependencies | |
run: cd electron && npm ci | |
- name: engine file | |
run: git clone https://github.com/deep-foundation/deeplinks.git && cp deeplinks/imports/engine.ts electron/src/engine.ts && npx rimraf -I deeplinks | |
# - name: pull hasura | |
# run: cd node_modules/@deep-foundation && rm -rf hasura && git clone https://github.com/deep-foundation/hasura.git && cd hasura && npm ci && npm run package:build && rm -rf node_modules && rm -rf package-lock.json && cd ../../.. && rm -rf electron/node_modules/@deep-foundation/hasura && cp -r node_modules/@deep-foundation/hasura electron/node_modules/@deep-foundation/hasura | |
# - name: pull store | |
# run: cd node_modules/@deep-foundation && rm -rf store && git clone https://github.com/deep-foundation/store.git && cd store && npm ci && npm run package:build && rm -rf node_modules && rm -rf package-lock.json && cd ../../.. && rm -rf electron/node_modules/@deep-foundation/store && cp -r node_modules/@deep-foundation/store electron/node_modules/@deep-foundation/store | |
- name: build next | |
run: npm run build && npm run export && npx rimraf electron/app && npx cap copy electron | |
- name: Build distribution | |
env: | |
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | |
CSC_LINK: ${{ secrets.CSC_LINK }} | |
APPLEID: ${{ secrets.APPLEID }} | |
APPLEIDPASS: ${{ secrets.APPLEIDPASS }} | |
run: cd electron && npm run electron:pack | |
- name: Create zip file | |
run: | | |
cd electron/dist/mac | |
ditto -c -k --keepParent deep-case.app deep-case.app.zip | |
- name: And a README (to work around GitHub double-zips) | |
run: | | |
echo "More information: https://deep.foundation" > electron/dist/mac/README.txt | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: deep-case-macOS | |
path: | | |
electron/dist/mac/deep-case.app.zip | |
electron/dist/mac/README.txt |