|
| 1 | +name: Build & Publish Electron App |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - dev |
| 7 | + - release |
| 8 | + - master |
| 9 | + |
| 10 | +jobs: |
| 11 | + build-macos: |
| 12 | + runs-on: macos-latest |
| 13 | + steps: |
| 14 | + - name: Checkout code |
| 15 | + uses: actions/checkout@v3 |
| 16 | + |
| 17 | + - name: Set up Node.js |
| 18 | + uses: actions/setup-node@v3 |
| 19 | + with: |
| 20 | + node-version: 18.18.0 |
| 21 | + |
| 22 | + - name: Decrypt SSH key for release branch |
| 23 | + if: github.ref == 'refs/heads/release' |
| 24 | + run: | |
| 25 | + openssl aes-256-cbc -K ${{ secrets.ENCRYPTED_FEC05B564C85_KEY }} -iv ${{ secrets.ENCRYPTED_FEC05B564C85_IV }} \ |
| 26 | + -in id_rsa.enc -out packaging/id_rsa -d |
| 27 | + chmod 600 packaging/id_rsa |
| 28 | +
|
| 29 | + - name: Add OSX certificate |
| 30 | + run: | |
| 31 | + chmod +x ./packaging/add-osx-cert.sh |
| 32 | + ./packaging/add-osx-cert.sh |
| 33 | +
|
| 34 | + - name: Install dependencies |
| 35 | + run: npm install |
| 36 | + |
| 37 | + - name: Run tests |
| 38 | + if: github.event.pull_request != null |
| 39 | + run: npm test |
| 40 | + |
| 41 | + - name: Build and Publish (only on non-PRs) |
| 42 | + if: github.event.pull_request == null |
| 43 | + env: |
| 44 | + GH_TOKEN: ${{ secrets.GH_TOKEN }} |
| 45 | + run: | |
| 46 | + npm test |
| 47 | + ./packaging/release --branch=${{ github.ref_name }} --dist=mac --platform=mac --token=$GH_TOKEN |
| 48 | +
|
| 49 | + build-windows: |
| 50 | + runs-on: windows-latest |
| 51 | + steps: |
| 52 | + - name: Checkout code |
| 53 | + uses: actions/checkout@v3 |
| 54 | + |
| 55 | + - name: Set up Node.js |
| 56 | + uses: actions/setup-node@v3 |
| 57 | + with: |
| 58 | + node-version: 18.18.0 |
| 59 | + |
| 60 | + - name: Install Windows build tools |
| 61 | + run: npm install --global --production windows-build-tools@4.0.0 |
| 62 | + |
| 63 | + - name: Set node config |
| 64 | + run: | |
| 65 | + npm config set python python2.7 |
| 66 | + npm config set msvs_version 2015 |
| 67 | +
|
| 68 | + - name: Install dependencies |
| 69 | + run: npm install |
| 70 | + |
| 71 | + - name: Run tests |
| 72 | + if: github.event.pull_request != null |
| 73 | + run: npm test |
| 74 | + |
| 75 | + - name: Build and Publish (only on non-PRs) |
| 76 | + if: github.event.pull_request == null |
| 77 | + env: |
| 78 | + GH_TOKEN: ${{ secrets.GH_TOKEN }} |
| 79 | + run: | |
| 80 | + npm test |
| 81 | + ./packaging/release --branch=${{ github.ref_name }} --dist=win --platform=win --token=$GH_TOKEN |
0 commit comments