Skip to content

Commit 949428b

Browse files
committed
ci: first draft GHA workflow
1 parent af8bde6 commit 949428b

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed
File renamed without changes.

.github/workflows/ci-cd.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
concurrency:
8+
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
9+
10+
permissions:
11+
contents: write # publish a GitHub release
12+
pages: write # deploy to GitHub Pages
13+
issues: write # comment on released issues
14+
pull-requests: write # comment on released pull requests
15+
16+
jobs:
17+
ci-cd:
18+
strategy:
19+
matrix:
20+
os:
21+
- macos-latest
22+
- windows-latest
23+
runs-on: ${{ matrix.os }}
24+
defaults:
25+
run:
26+
shell: bash
27+
environment:
28+
name: ${{ matrix.os }}
29+
steps:
30+
- uses: actions/checkout@v3
31+
- uses: actions/setup-node@v3
32+
with:
33+
cache: 'npm'
34+
node-version-file: '.nvmrc'
35+
- name: Debug info
36+
run: |
37+
cat <<EOF
38+
Node version: $(node --version)
39+
NPM version: $(npm --version)
40+
GitHub ref: ${{ github.ref }}
41+
GitHub head ref: ${{ github.head_ref }}
42+
Working directory: $(pwd)
43+
EOF
44+
- name: Install NPM dependencies
45+
run: npm ci
46+
- name: Test
47+
run: npm run test
48+
- name: Fastlane
49+
if: matrix.os == 'macos-latest' && vars.SCRATCH_SHOULD_SIGN
50+
run: fastlane circleci
51+
- name: Build
52+
timeout-minutes: 30 # macOS notarization can take a while
53+
env:
54+
# TODO: fix whatever is causing excessive memory usage during build
55+
NODE_OPTIONS: --max-old-space-size=4096
56+
# These will be blank on macOS and on unsigned builds
57+
# macOS CSC info was set by Fastlane above
58+
WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
59+
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
60+
run: npm run ${{ vars.SCRATCH_SHOULD_SIGN && 'dist' || 'distDev' }}
61+
- name: Zip MAS-Dev build
62+
if: matrix.os == 'macos-latest'
63+
run: |
64+
NPM_APP_VERSION="`node -pe "require('./package.json').version"`"
65+
cd dist/mas-dev
66+
ditto -v -c -k --sequesterRsrc --keepParent --zlibCompressionLevel 9 \
67+
Scratch*.app ../mas-dev-${NPM_APP_VERSION}.zip
68+
- name: Upload macOS artifacts
69+
uses: actions/upload-artifact@v2
70+
if: matrix.os == 'macos-latest'
71+
with:
72+
name: macOS
73+
path: |
74+
dist/Scratch*.dmg
75+
dist/mas/Scratch*.pkg
76+
dist/mas-dev-*.zip
77+
- name: Upload Windows artifacts
78+
uses: actions/upload-artifact@v2
79+
if: matrix.os == 'windows-latest'
80+
with:
81+
name: Windows
82+
path: |
83+
dist/Scratch*.appx
84+
dist/Scratch*.exe

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16

0 commit comments

Comments
 (0)