PortKiller consumes excessive memory after running for some time #53
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
| # PR build workflow - calls release.yml as reusable workflow | |
| name: PR Build Test | |
| on: | |
| issue_comment: | |
| types: [created] | |
| workflow_dispatch: | |
| inputs: | |
| pr_number: | |
| description: 'PR number to build' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| # Setup job: React to comment and get PR info | |
| setup: | |
| name: Setup | |
| runs-on: ubuntu-latest | |
| # Run on PR comments with /test-build OR manual dispatch | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event.issue.pull_request && contains(github.event.comment.body, '/test-build')) | |
| outputs: | |
| ref: ${{ steps.pr.outputs.ref }} | |
| pr_number: ${{ steps.pr.outputs.pr_number }} | |
| steps: | |
| - name: React to comment | |
| if: github.event_name == 'issue_comment' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| await github.rest.reactions.createForIssueComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: context.payload.comment.id, | |
| content: 'rocket' | |
| }); | |
| - name: Get PR branch | |
| id: pr | |
| uses: actions/github-script@v7 | |
| env: | |
| INPUT_PR_NUMBER: ${{ inputs.pr_number }} | |
| with: | |
| script: | | |
| const prNumber = process.env.INPUT_PR_NUMBER || context.issue.number; | |
| const pr = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: parseInt(prNumber) | |
| }); | |
| core.setOutput('ref', pr.data.head.ref); | |
| core.setOutput('pr_number', prNumber); | |
| # Build job: Call release.yml as reusable workflow | |
| build: | |
| name: Build | |
| needs: setup | |
| uses: ./.github/workflows/release.yml | |
| with: | |
| is_pr_build: true | |
| pr_number: ${{ needs.setup.outputs.pr_number }} | |
| version_override: '0.0.0-pr${{ needs.setup.outputs.pr_number }}' | |
| ref: ${{ needs.setup.outputs.ref }} | |
| secrets: inherit | |
| # Comment job: Post download link on PR | |
| comment: | |
| name: Comment on PR | |
| needs: [setup, build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Comment on PR | |
| uses: actions/github-script@v7 | |
| env: | |
| PR_NUMBER: ${{ needs.setup.outputs.pr_number }} | |
| with: | |
| script: | | |
| const runUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`; | |
| const prNumber = process.env.PR_NUMBER; | |
| const dmgName = `PortKiller-pr${prNumber}-macos.dmg`; | |
| const body = [ | |
| '## Build completed!', | |
| '', | |
| `**DMG:** \`${dmgName}\``, | |
| `**Download:** [View artifacts](${runUrl}#artifacts)`, | |
| '', | |
| '_Fully signed and notarized. Artifact expires in 7 days._' | |
| ].join('\n'); | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: parseInt(prNumber), | |
| body: body | |
| }); | |