Disable electron-builder auto publish #3
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| create-release: | |
| name: Create GitHub release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Create release if missing | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| if gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then | |
| echo "Release ${GITHUB_REF_NAME} already exists." | |
| else | |
| gh release create "${GITHUB_REF_NAME}" \ | |
| --repo "${GITHUB_REPOSITORY}" \ | |
| --title "ZenNotes ${GITHUB_REF_NAME}" \ | |
| --notes "Download the installer for your platform from the assets below." | |
| fi | |
| build-and-upload: | |
| name: Release ${{ matrix.name }} | |
| needs: create-release | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: macOS | |
| os: macos-latest | |
| command: npm run dist:mac | |
| - name: Windows | |
| os: windows-latest | |
| command: npm run dist:win | |
| - name: Linux | |
| os: ubuntu-latest | |
| command: npm run dist:linux | |
| env: | |
| CSC_IDENTITY_AUTO_DISCOVERY: "false" | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build release artifacts | |
| run: ${{ matrix.command }} | |
| - name: Upload assets to GitHub Release | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| mapfile -d '' files < <( | |
| find dist -maxdepth 1 -type f \ | |
| \( -name '*.dmg' -o -name '*.zip' -o -name '*.exe' -o -name '*.AppImage' -o -name '*.deb' -o -name '*.blockmap' -o -name 'latest*.yml' -o -name 'latest*.yaml' \) \ | |
| -print0 | |
| ) | |
| if [ "${#files[@]}" -eq 0 ]; then | |
| echo "No release artifacts found in dist/" >&2 | |
| exit 1 | |
| fi | |
| gh release upload "${GITHUB_REF_NAME}" \ | |
| --repo "${GITHUB_REPOSITORY}" \ | |
| --clobber \ | |
| "${files[@]}" |