Build / Electron #8
Workflow file for this run
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' }} | |
| GH_TOKEN: ${{ secrets.github_token }} | |
| 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: Install dependencies and build web assets | |
| run: | | |
| npm install | |
| # Linux build | |
| - name: Build Electron app (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| cd electron | |
| npm run build | |
| # macOS build | |
| - name: Build Electron app (macOS) | |
| if: matrix.os == 'macos-14' | |
| env: | |
| CSC_LINK: ${{ secrets.mac_certs }} | |
| CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }} | |
| run: | | |
| cd electron | |
| npm run build | |
| # Windows build | |
| - name: Build Electron app (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| cd electron | |
| npm run build |