55 - ' *'
66 workflow_dispatch :
77
8+ env :
9+ REF_NAME : ${{ github.ref_name }}
10+
811jobs :
912 phar :
1013 name : Compile PHAR
1114 runs-on : ubuntu-latest
15+ permissions :
16+ contents : read
1217 steps :
1318 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1419 with :
15- fetch-depth : 0
20+ persist-credentials : false
1621
1722 # Prepare environment
1823 - name : Setup PHP
2833 uses : ramsey/composer-install@5c2bcf28d7b060ef3c601d7b476d5430a7b46c27 # v4
2934 with :
3035 composer-options : " --no-dev"
36+ ignore-cache : true
3137 - name : Compile PHAR
3238 run : ./tools/box compile --with-docker
3339
@@ -54,16 +60,19 @@ jobs:
5460 name : Docker deploy
5561 runs-on : ubuntu-latest
5662 needs : phar
63+ permissions :
64+ contents : read
65+ packages : write
5766 steps :
5867 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
5968 with :
60- fetch-depth : 0
69+ persist-credentials : false
6170
6271 # Check if tag is valid
6372 - name : Check tag
6473 if : ${{ github.event_name != 'workflow_dispatch' }}
6574 run : |
66- if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3} $ ]]; then
75+ if ! [[ "$REF_NAME" =~ ^\d+\.\d+\.\d+ $ ]]; then
6776 exit 1
6877 fi
6978
8695 tags : |
8796 type=raw,value=latest,enable=${{ github.event_name != 'workflow_dispatch' }}
8897 type=semver,pattern={{version}}
89- type=raw,value=${{ github.ref_name }},enable=${{ github.event_name == 'workflow_dispatch' }}
98+ type=raw,value=${{ env.REF_NAME }},enable=${{ github.event_name == 'workflow_dispatch' }}
9099
91100 # Prepare build
92101 - name : Set up QEMU
@@ -126,8 +135,6 @@ jobs:
126135 environment :
127136 name : github-pages
128137 url : ${{ steps.deployment.outputs.page_url }}
129-
130- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
131138 permissions :
132139 contents : read
133140 pages : write
@@ -141,14 +148,14 @@ jobs:
141148 steps :
142149 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
143150 with :
144- fetch-depth : 0
151+ persist-credentials : false
145152
146153 # Prepare environment
147154 - name : Setup Node
148155 uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
149156 with :
150157 node-version : 24
151- cache : npm
158+ package-manager- cache : false
152159 - name : Setup PHP
153160 uses : shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2
154161 with :
@@ -201,15 +208,17 @@ jobs:
201208 if : ${{ github.event_name != 'workflow_dispatch' }}
202209 runs-on : ubuntu-latest
203210 needs : phar
211+ permissions :
212+ contents : write
204213 steps :
205214 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
206215 with :
207- fetch-depth : 0
216+ persist-credentials : false
208217
209218 # Check if tag is valid
210219 - name : Check tag
211220 run : |
212- if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3} $ ]]; then
221+ if ! [[ "${REF_NAME}" =~ ^\d+\.\d+\.\d+ $ ]]; then
213222 exit 1
214223 fi
215224
@@ -223,7 +232,6 @@ jobs:
223232
224233 # Create release
225234 - name : Create release
226- uses : ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1
227- with :
228- generateReleaseNotes : true
229- artifacts : .build/cache-warmup.phar,.build/cache-warmup.phar.asc
235+ env :
236+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
237+ run : gh release create "${REF_NAME}" --generate-notes .build/cache-warmup.phar .build/cache-warmup.phar.asc
0 commit comments