|
8 | 8 |
|
9 | 9 | jobs: |
10 | 10 |
|
11 | | - build: #--------------------------------------------------------------------- |
| 11 | + build: #---------------------------------------------------------------------- |
12 | 12 | name: Build Phar |
13 | 13 | runs-on: ubuntu-latest |
14 | 14 |
|
@@ -187,7 +187,7 @@ jobs: |
187 | 187 | WP_VERSION: '${{ matrix.wp }}' |
188 | 188 | run: composer behat || composer behat-rerun |
189 | 189 |
|
190 | | - deploy: #----------------------------------------------------------------------- |
| 190 | + deploy: #--------------------------------------------------------------------- |
191 | 191 | name: Deployment |
192 | 192 | runs-on: ubuntu-latest |
193 | 193 | needs: [build, test] |
@@ -251,7 +251,54 @@ jobs: |
251 | 251 | branch: gh-pages |
252 | 252 | repository: wp-cli/builds |
253 | 253 |
|
254 | | - build-rpm: #----------------------------------------------------------------------- |
| 254 | + deploy-shim: #---------------------------------------------------------------- |
| 255 | + name: Deployment |
| 256 | + runs-on: ubuntu-latest |
| 257 | + needs: [build, test] |
| 258 | + |
| 259 | + if: ${{ github.repository_owner == 'wp-cli' }} |
| 260 | + steps: |
| 261 | + - name: Check out phar repository |
| 262 | + uses: actions/checkout@v4 |
| 263 | + with: |
| 264 | + repository: wp-cli/phar |
| 265 | + token: ${{ secrets.ACTIONS_BOT }} |
| 266 | + |
| 267 | + - name: Download WP-CLI version |
| 268 | + uses: actions/download-artifact@v3 |
| 269 | + with: |
| 270 | + name: cli_version |
| 271 | + |
| 272 | + - name: Download built Phar file |
| 273 | + uses: actions/download-artifact@v3 |
| 274 | + with: |
| 275 | + name: wp-cli-phar |
| 276 | + |
| 277 | + - name: Make built Phar executable |
| 278 | + run: | |
| 279 | + chmod +x wp-cli.phar |
| 280 | +
|
| 281 | + - name: Commit files |
| 282 | + run: | |
| 283 | + git config --local user.email "action@github.com" |
| 284 | + git config --local user.name "GitHub Action" |
| 285 | + git add wp-cli.phar |
| 286 | + git commit -m "phar build: $GITHUB_REPOSITORY@$GITHUB_SHA" |
| 287 | +
|
| 288 | + - name: Tag stable release |
| 289 | + if: ${{ contains(github.ref, 'release') }} |
| 290 | + run: | |
| 291 | + VERSION=$(cat cli_version.txt) |
| 292 | + git tag "v$VERSION" |
| 293 | +
|
| 294 | + - name: Push changes |
| 295 | + uses: ad-m/github-push-action@master |
| 296 | + with: |
| 297 | + github_token: ${{ secrets.ACTIONS_BOT }} |
| 298 | + branch: gh-pages |
| 299 | + repository: wp-cli/phar |
| 300 | + |
| 301 | + build-rpm: #------------------------------------------------------------------ |
255 | 302 | name: Build RPM package |
256 | 303 | runs-on: ubuntu-latest |
257 | 304 | if: ${{ contains(github.ref, 'release') && github.repository_owner == 'wp-cli' }} |
@@ -305,7 +352,7 @@ jobs: |
305 | 352 | branch: gh-pages |
306 | 353 | repository: wp-cli/builds |
307 | 354 |
|
308 | | - build-deb: #----------------------------------------------------------------------- |
| 355 | + build-deb: #------------------------------------------------------------------ |
309 | 356 | name: Build DEB package |
310 | 357 | runs-on: ubuntu-latest |
311 | 358 | if: ${{ contains(github.ref, 'release') && github.repository_owner == 'wp-cli' }} |
|
0 commit comments