name: Build & Release on: push: branches: - master tags: - v* pull_request: jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Setup Node.js uses: actions/setup-node@v1 with: node-version: 12.x - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - uses: actions/cache@v1 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - name: Install run: yarn - name: lint run: yarn lint build: needs: lint runs-on: ${{ matrix.platform.host }} strategy: matrix: platform: - host: windows-latest target: win32 - host: macOS-latest target: darwin - host: ubuntu-latest target: linux steps: - uses: actions/checkout@v2 - name: Setup Node.js uses: actions/setup-node@v1 with: node-version: 12.x - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - uses: actions/cache@v1 if: matrix.platform.host != 'macOS-latest' id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - name: Set MacOS signing certs if: matrix.os == 'macos-latest' run: chmod +x tools/add-osx-cert.sh && ./tools/add-osx-cert.sh env: CERTIFICATE_OSX_APPLICATION: ${{ secrets.MACOS_CERT_P12 }} CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }} - name: Set Windows signing certificate if: matrix.os == 'windows-latest' id: write_file uses: timheuer/base64-to-file@v1 with: fileName: 'win-certificate.pfx' encodedString: ${{ secrets.WINDOWS_CODESIGN_P12 }} - name: Install run: yarn - name: Make # if: startsWith(github.ref, 'refs/tags/') run: yarn make env: APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} WINDOWS_CODESIGN_FILE: ${{ steps.write_file.outputs.filePath }} WINDOWS_CODESIGN_PASSWORD: ${{ secrets.WINDOWS_CODESIGN_PASSWORD }} - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: files: | electron-app/out/**/*.deb electron-app/out/**/*.dmg electron-app/out/**/*Setup.exe electron-app/out/**/*.rpm electron-app/out/**/*.zip