Merge pull request #7 from dzikus/pidscope #7
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*' | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| permissions: {} | |
| jobs: | |
| # Stage 1: Build Docker builder images (3 parallel) | |
| build-appimage-builder: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push builder image | |
| run: | | |
| docker build -t ${{ env.REGISTRY }}/${{ github.repository_owner }}/pidscope-builder-appimage:latest ./packaging/appimage | |
| docker push ${{ env.REGISTRY }}/${{ github.repository_owner }}/pidscope-builder-appimage:latest | |
| build-windows-builder: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push builder image | |
| run: | | |
| docker build -t ${{ env.REGISTRY }}/${{ github.repository_owner }}/pidscope-builder-windows:latest ./packaging/windows | |
| docker push ${{ env.REGISTRY }}/${{ github.repository_owner }}/pidscope-builder-windows:latest | |
| build-macos-builder: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push builder image | |
| run: | | |
| docker build -t ${{ env.REGISTRY }}/${{ github.repository_owner }}/pidscope-builder-macos:latest ./packaging/macos | |
| docker push ${{ env.REGISTRY }}/${{ github.repository_owner }}/pidscope-builder-macos:latest | |
| # Stage 2: Build packages (each depends only on its own builder) | |
| build-appimage: | |
| needs: build-appimage-builder | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: read | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build AppImage | |
| run: | | |
| mkdir -p dist | |
| docker pull ${{ env.REGISTRY }}/${{ github.repository_owner }}/pidscope-builder-appimage:latest | |
| docker run --rm \ | |
| -v ${{ github.workspace }}:/src \ | |
| -v ${{ github.workspace }}/dist:/dist \ | |
| ${{ env.REGISTRY }}/${{ github.repository_owner }}/pidscope-builder-appimage:latest | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: appimage | |
| path: dist/PIDscope-*-x86_64.AppImage | |
| build-windows: | |
| needs: build-windows-builder | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: read | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Windows ZIP | |
| run: | | |
| mkdir -p dist | |
| docker pull ${{ env.REGISTRY }}/${{ github.repository_owner }}/pidscope-builder-windows:latest | |
| docker run --rm \ | |
| -v ${{ github.workspace }}:/src \ | |
| -v ${{ github.workspace }}/dist:/dist \ | |
| ${{ env.REGISTRY }}/${{ github.repository_owner }}/pidscope-builder-windows:latest | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: windows-zip | |
| path: dist/PIDscope-*-windows-x86_64.zip | |
| build-macos: | |
| needs: build-macos-builder | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: read | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build macOS ZIP | |
| run: | | |
| mkdir -p dist | |
| docker pull ${{ env.REGISTRY }}/${{ github.repository_owner }}/pidscope-builder-macos:latest | |
| docker run --rm \ | |
| -v ${{ github.workspace }}:/src \ | |
| -v ${{ github.workspace }}/dist:/dist \ | |
| ${{ env.REGISTRY }}/${{ github.repository_owner }}/pidscope-builder-macos:latest | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: macos-zip | |
| path: dist/PIDscope-*-macos-universal.zip | |
| # Stage 3: Create GitHub Release | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: [build-appimage, build-windows, build-macos] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 | |
| with: | |
| path: artifacts | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2 | |
| with: | |
| files: | | |
| artifacts/appimage/* | |
| artifacts/windows-zip/* | |
| artifacts/macos-zip/* | |
| generate_release_notes: true | |
| draft: ${{ contains(github.ref_name, 'beta') }} | |
| prerelease: ${{ contains(github.ref_name, 'rc') || contains(github.ref_name, 'beta') }} |