release: v2.4.23 #249
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 & Release | |
| on: | |
| push: | |
| branches: [release] | |
| tags: ['v*'] | |
| workflow_dispatch: | |
| inputs: | |
| publish: | |
| description: 'Publish to GitHub Releases' | |
| type: boolean | |
| default: false | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-latest, ubuntu-latest] | |
| include: | |
| - os: macos-latest | |
| release_cmd: release:mac:universal | |
| ci_cmd: build:mac:ci | |
| artifact_path: | | |
| dist-electron/*.dmg | |
| dist-electron/*.zip | |
| dist-electron/latest-mac.yml | |
| - os: ubuntu-latest | |
| release_cmd: release:linux | |
| ci_cmd: build:linux:ci | |
| artifact_path: | | |
| dist-electron/*.deb | |
| dist-electron/*.AppImage | |
| dist-electron/latest-linux.yml | |
| dist-electron/latest-linux-arm64.yml | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22.15.1' | |
| cache: 'pnpm' | |
| - uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cache/electron | |
| ~/.cache/electron-builder | |
| key: ${{ runner.os }}-electron-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: ${{ runner.os }}-electron- | |
| - run: pnpm install | |
| - name: Build and optionally publish | |
| run: | | |
| if [[ "${{ github.ref_type }}" == "tag" ]] || [[ "${{ inputs.publish }}" == "true" ]]; then | |
| echo "Release build — publishing to GitHub Releases" | |
| pnpm run ${{ matrix.release_cmd }} | |
| else | |
| echo "CI build — artifacts only" | |
| pnpm run ${{ matrix.ci_cmd }} | |
| fi | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CSC_IDENTITY_AUTO_DISCOVERY: 'false' | |
| CSC_DISABLE: 'true' | |
| - run: ls -la dist-electron/ | |
| - name: Verify packaged headless remote setup | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| case "$(uname -m)" in | |
| x86_64) appimage_pattern='*x86_64.AppImage' ;; | |
| aarch64|arm64) appimage_pattern='*arm64.AppImage' ;; | |
| *) echo "Unsupported runner architecture: $(uname -m)" >&2; exit 2 ;; | |
| esac | |
| appimage="$(find dist-electron -maxdepth 1 -name "$appimage_pattern" -print -quit)" | |
| scripts/test-packaged-headless-remote-setup.sh "$appimage" | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: pane-${{ matrix.os }}-${{ github.ref_name }} | |
| path: ${{ matrix.artifact_path }} | |
| if-no-files-found: error | |
| retention-days: 30 | |
| publish-release: | |
| if: github.ref_type == 'tag' | |
| needs: [publish-windows] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Publish GitHub Release | |
| run: gh release edit "${{ github.ref_name }}" --repo "${{ github.repository }}" --draft=false --latest | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| checksums: | |
| if: github.ref_type == 'tag' | |
| needs: [publish-release] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download release assets | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| mkdir -p assets && cd assets | |
| gh release download "v${VERSION}" --repo dcouple/Pane \ | |
| --pattern '*.exe' --pattern '*.dmg' --pattern '*.zip' \ | |
| --pattern '*.deb' --pattern '*.AppImage' | |
| - name: Compute SHA256 | |
| run: | | |
| cd assets | |
| sha256sum * > ../SHA256SUMS.txt | |
| cat ../SHA256SUMS.txt | |
| - name: Upload SHA256SUMS.txt to release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| gh release upload "v${VERSION}" SHA256SUMS.txt \ | |
| --repo dcouple/Pane --clobber | |
| validate-runpane-packages: | |
| if: github.ref_type == 'tag' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22.15.1' | |
| cache: 'pnpm' | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - run: pnpm install --filter runpane --ignore-scripts | |
| - run: pnpm run check:runpane-package-versions | |
| - run: pnpm --filter runpane build | |
| - run: pnpm run test:runpane-contract | |
| - run: pnpm run test:runpane-package-smoke | |
| publish-npm: | |
| if: github.ref_type == 'tag' | |
| needs: [checksums, validate-runpane-packages] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22.15.1' | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'pnpm' | |
| - name: Ensure npm supports trusted publishing | |
| run: npm install -g npm@^11.5.1 | |
| - run: pnpm install | |
| - run: pnpm --filter runpane build | |
| - name: Publish runpane to npm with token fallback | |
| if: ${{ env.NPM_TOKEN != '' }} | |
| working-directory: packages/runpane | |
| env: | |
| NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }} | |
| run: npm publish --access public | |
| - name: Publish runpane to npm with trusted publishing | |
| if: ${{ env.NPM_TOKEN == '' }} | |
| working-directory: packages/runpane | |
| run: npm publish --access public | |
| publish-pypi: | |
| if: github.ref_type == 'tag' | |
| needs: [checksums, validate-runpane-packages] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/runpane | |
| permissions: | |
| contents: read | |
| id-token: write | |
| env: | |
| PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Build Python distribution | |
| run: | | |
| python -m pip install --upgrade build | |
| python -m build packages/runpane-py | |
| - name: Publish runpane to PyPI with token fallback | |
| if: ${{ env.PYPI_API_TOKEN != '' }} | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: packages/runpane-py/dist | |
| password: ${{ env.PYPI_API_TOKEN }} | |
| - name: Publish runpane to PyPI with trusted publishing | |
| if: ${{ env.PYPI_API_TOKEN == '' }} | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: packages/runpane-py/dist | |
| build-windows: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [x64, arm64] | |
| runs-on: windows-2022 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22.15.1' | |
| cache: 'pnpm' | |
| - uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/AppData/Local/electron/Cache | |
| ~/AppData/Local/electron-builder/Cache | |
| key: windows-${{ matrix.arch }}-electron-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: windows-${{ matrix.arch }}-electron- | |
| - run: pnpm install | |
| - name: Build Windows artifact | |
| run: | | |
| Write-Host "Building Windows ${{ matrix.arch }} artifact without publishing" | |
| node scripts/build-win.js ${{ matrix.arch }} | |
| - run: dir dist-electron | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: pane-windows-${{ matrix.arch }}-${{ github.ref_name }} | |
| path: | | |
| dist-electron/*-Windows-${{ matrix.arch }}.exe | |
| dist-electron/*-Windows-${{ matrix.arch }}.exe.blockmap | |
| dist-electron/latest.yml | |
| if-no-files-found: error | |
| retention-days: 30 | |
| publish-windows: | |
| if: github.ref_type == 'tag' || inputs.publish == true | |
| needs: [build, build-windows] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22.15.1' | |
| cache: 'pnpm' | |
| - run: pnpm install --ignore-scripts | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: pane-windows-x64-${{ github.ref_name }} | |
| path: windows-artifacts/x64 | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: pane-windows-arm64-${{ github.ref_name }} | |
| path: windows-artifacts/arm64 | |
| - name: Merge Windows updater metadata | |
| run: | | |
| mkdir -p windows-release | |
| cp windows-artifacts/x64/*-Windows-x64.exe windows-release/ | |
| cp windows-artifacts/x64/*-Windows-x64.exe.blockmap windows-release/ | |
| cp windows-artifacts/arm64/*-Windows-arm64.exe windows-release/ | |
| cp windows-artifacts/arm64/*-Windows-arm64.exe.blockmap windows-release/ | |
| node scripts/merge-windows-latest.js \ | |
| windows-artifacts/x64/latest.yml \ | |
| windows-artifacts/arm64/latest.yml \ | |
| windows-release/latest.yml | |
| ls -la windows-release | |
| - name: Upload Windows release assets | |
| run: | | |
| VERSION="$(node -p "require('./package.json').version")" | |
| TAG="v${VERSION}" | |
| if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then | |
| TAG="${GITHUB_REF_NAME}" | |
| fi | |
| gh release upload "${TAG}" windows-release/* \ | |
| --repo "${{ github.repository }}" --clobber | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |