Build / Electron #2
This file contains hidden or 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: Build / Electron | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| brand: | |
| description: 'Brand to build' | |
| required: false | |
| type: choice | |
| default: 'remoteit' | |
| options: | |
| - remoteit | |
| - cachengo | |
| skip_signing: | |
| description: 'Skip code signing' | |
| required: false | |
| type: boolean | |
| default: true | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| CI: '' | |
| FONT_AWESOME_AUTH_TOKEN: ${{ secrets.FONT_AWESOME_AUTH_TOKEN }} | |
| SKIP_SIGNING: ${{ inputs.skip_signing }} | |
| BRAND: ${{ inputs.brand || 'remoteit' }} | |
| jobs: | |
| release: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-14, windows-latest] | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v3 | |
| - name: Get version from package.json | |
| id: version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "VERSION=v$VERSION" >> $GITHUB_OUTPUT | |
| - name: Install Node.js, NPM and Yarn | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| - name: Set npm version | |
| run: npm install -g npm@10 | |
| - name: Authenticate with fontawesome NPM repo | |
| run: | | |
| npm config set "@fortawesome:registry" https://npm.fontawesome.com/ | |
| npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.FONT_AWESOME_AUTH_TOKEN }} | |
| - name: Create .env file | |
| run: echo "${{ secrets.ENV_FILE }}" > .env | |
| - name: Install SSL.com Sign Tool on Windows | |
| shell: bash | |
| if: matrix.os == 'windows-latest' && !inputs.skip_signing | |
| run: | | |
| curl https://www.ssl.com/download/codesigntool-for-windows/ --output ~/Downloads/CodeSignTool.zip | |
| unzip ~/Downloads/CodeSignTool.zip -d ~/CodeSignTool | |
| - name: Build and install dependencies | |
| run: | | |
| npm install | |
| npm run build-frontend | |
| npm run build-backend | |
| cd electron | |
| npm install ../backend/dist/remoteit-headless.tgz | |
| - name: Build Electron app | |
| run: | | |
| cd electron | |
| npm install | |
| npm run build | |
| env: | |
| GH_TOKEN: ${{ secrets.github_token }} | |
| CSC_LINK: ${{ secrets.mac_certs }} | |
| CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }} |