|
| 1 | +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node |
| 2 | +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs |
| 3 | + |
| 4 | +name: Node.js CI |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [ "main" ] |
| 9 | + pull_request: |
| 10 | + branches: [ "main" ] |
| 11 | + |
| 12 | +env: |
| 13 | + GH_TOKEN: ${{ secrets.GH_TOKEN }} |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + node-version: [ 22.x ] |
| 23 | + os: [ ubuntu-latest, macos-latest, windows-latest ] |
| 24 | + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ |
| 25 | + |
| 26 | + steps: |
| 27 | + |
| 28 | + - name: Checkout repository |
| 29 | + uses: actions/checkout@v4 |
| 30 | + |
| 31 | + - name: Create package-lock.json |
| 32 | + shell: sh |
| 33 | + run: | |
| 34 | + cat << EOF > package-lock.json |
| 35 | + { |
| 36 | + "name": "electron-vvt", |
| 37 | + "version": "0.0.1", |
| 38 | + "lockfileVersion": 3, |
| 39 | + "requires": true, |
| 40 | + "packages": { |
| 41 | + "": { |
| 42 | + "name": "electron-vvt", |
| 43 | + "version": "0.0.1", |
| 44 | + "license": "Apache-2.0", |
| 45 | + "engines": { |
| 46 | + "node": ">=20" |
| 47 | + } |
| 48 | + } |
| 49 | + } |
| 50 | + } |
| 51 | + EOF |
| 52 | +
|
| 53 | + - name: Use Node.js ${{ matrix.node-version }} |
| 54 | + uses: actions/setup-node@v4 |
| 55 | + with: |
| 56 | + node-version: ${{ matrix.node-version }} |
| 57 | + cache: 'npm' |
| 58 | + |
| 59 | + - name: Delete .npmrc |
| 60 | + shell: sh |
| 61 | + run: rm -rf .npmrc |
| 62 | + |
| 63 | + - name: Install dependencies |
| 64 | + run: npm install |
| 65 | + |
| 66 | + - name: Build with npm |
| 67 | + run: npm run build |
| 68 | + |
| 69 | + - name: List files in release folder |
| 70 | + shell: sh |
| 71 | + run: ls -la release/**/** |
| 72 | + |
| 73 | + - name: Upload release artifacts |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: release-${{ matrix.os }} |
| 77 | + path: | |
| 78 | + release/**/** |
| 79 | + !release/**/linux-unpacked |
| 80 | + !release/**/win-unpacked |
| 81 | + !release/**/*.app |
| 82 | + !release/**/builder-debug.yml |
0 commit comments