1- name : " Release "
1+ name : " Publish the PHAR for Releases "
22
33on :
44 release :
@@ -9,58 +9,32 @@ permissions:
99 contents : read
1010
1111jobs :
12+ build-phar :
13+ # See build-phar.yml for a list of the permissions and why they are needed
14+ permissions :
15+ contents : read
16+ id-token : write
17+ attestations : write
18+ uses : ./.github/workflows/build-phar.yml
19+
1220 release-phar :
13- runs-on : ${{ matrix.operating-system }}
14- strategy :
15- matrix :
16- operating-system :
17- - ubuntu-latest
18- php-versions :
19- - ' 8.1'
21+ runs-on : ubuntu-latest
22+ needs :
23+ - build-phar
2024 permissions :
2125 # contents:write is required to upload the binaries to the release.
2226 contents : write
23- # id-token:write is required for build provenance attestation.
24- id-token : write
25- # attestations:write is required for build provenance attestation.
26- attestations : write
2727 steps :
28- - name : Setup PHP
29- uses : shivammathur/setup-php@v2
30- with :
31- coverage : none
32- tools : composer, box
33- php-version : " ${{ matrix.php-version }}"
34- - uses : actions/checkout@v4
35- with :
36- fetch-depth : 0
37- - uses : ramsey/composer-install@v3
38- - name : Build PHAR
39- run : box compile
40- - name : Check the PHAR executes
41- run : php pie.phar --version
42- - name : Import GPG key
43- uses : crazy-max/ghaction-import-gpg@v6
44- with :
45- gpg_private_key : ${{ secrets.GPG_SIGNING_KEY }}
46- passphrase : ${{ secrets.GPG_SIGNING_KEY_PASSPHRASE }}
47- - name : Sign the PHAR
48- run : |
49- gpg --local-user asgrim+pie-releases@php.net \
50- --batch \
51- --yes \
52- --passphrase="${{ secrets.GPG_SIGNING_KEY_PASSPHRASE }}" \
53- --detach-sign \
54- --output pie.phar.asc \
55- pie.phar
56- - name : Generate build provenance attestation
57- uses : actions/attest-build-provenance@v1
28+ - name : Fetch built PHAR from artifacts
29+ uses : actions/download-artifact@v4
5830 with :
59- subject-path : ' ${{ github.workspace }}/pie.phar'
31+ name : pie-${{ github.sha }}.phar
32+ - name : Verify the PHAR
33+ env :
34+ GH_TOKEN : ${{ github.token }}
35+ run : gh attestation verify pie.phar --repo ${{ github.repository }}
6036 - name : Upload binaries to release
6137 uses : softprops/action-gh-release@v2
6238 if : ${{startsWith(github.ref, 'refs/tags/') }}
6339 with :
64- files : |
65- pie.phar
66- pie.phar.asc
40+ files : pie.phar
0 commit comments