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: "Publish the PHAR for Releases" | |
| on: | |
| release: | |
| types: | |
| - published | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-phar: | |
| # See build-phar.yml for a list of the permissions and why they are needed | |
| permissions: | |
| contents: read | |
| id-token: write | |
| attestations: write | |
| uses: ./.github/workflows/build-phar.yml | |
| release-phar: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-phar | |
| permissions: | |
| # contents:write is required to upload the binaries to the release. | |
| contents: write | |
| steps: | |
| - name: Fetch built PHAR from artifacts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: pie-${{ github.sha }}.phar | |
| - name: Verify the PHAR | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: gh attestation verify pie.phar --repo ${{ github.repository }} | |
| - name: Upload binaries to release | |
| uses: softprops/action-gh-release@v2 | |
| if: ${{startsWith(github.ref, 'refs/tags/') }} | |
| with: | |
| files: pie.phar | |
| build-and-push-docker-image: | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| needs: build-phar | |
| # See build-and-push-docker-image.yml for a list of the permissions and why they are needed | |
| permissions: | |
| contents: read | |
| id-token: write | |
| attestations: write | |
| packages: write | |
| uses: ./.github/workflows/build-and-push-docker-image.yml | |
| with: | |
| # @TODO v1.0 Consider introducing more granular tags (major and major.minor) | |
| # @see https://github.com/php/pie/pull/122#pullrequestreview-2477496308 | |
| # @see https://github.com/php/pie/pull/122#discussion_r1867331273 | |
| tags: | | |
| ${{ ((!contains(github.ref, 'alpha') && !contains(github.ref, 'beta') && !contains(github.ref, 'rc')) && 'type=raw,value=bin') || '' }} | |
| type=semver,pattern={{version}}-bin |