Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build step for wp-cli/wp-cli-shim #592

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 51 additions & 4 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:

build: #---------------------------------------------------------------------
build: #----------------------------------------------------------------------
swissspidy marked this conversation as resolved.
Show resolved Hide resolved
name: Build Phar
runs-on: ubuntu-latest

Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
WP_VERSION: '${{ matrix.wp }}'
run: composer behat || composer behat-rerun

deploy: #-----------------------------------------------------------------------
deploy: #---------------------------------------------------------------------
name: Deployment
runs-on: ubuntu-latest
needs: [build, test]
Expand Down Expand Up @@ -251,7 +251,54 @@ jobs:
branch: gh-pages
repository: wp-cli/builds

build-rpm: #-----------------------------------------------------------------------
deploy-shim: #----------------------------------------------------------------
name: Deployment
runs-on: ubuntu-latest
needs: [build, test]

if: ${{ github.repository_owner == 'wp-cli' }}
steps:
- name: Check out phar repository
uses: actions/checkout@v4
with:
repository: wp-cli/phar
swissspidy marked this conversation as resolved.
Show resolved Hide resolved
token: ${{ secrets.ACTIONS_BOT }}

- name: Download WP-CLI version
uses: actions/download-artifact@v3
with:
name: cli_version

- name: Download built Phar file
uses: actions/download-artifact@v3
with:
name: wp-cli-phar

- name: Make built Phar executable
run: |
chmod +x wp-cli.phar
swissspidy marked this conversation as resolved.
Show resolved Hide resolved

- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add wp-cli.phar
git commit -m "phar build: $GITHUB_REPOSITORY@$GITHUB_SHA"

- name: Tag stable release
if: ${{ contains(github.ref, 'release') }}
run: |
VERSION=$(cat cli_version.txt)
git tag "v$VERSION"
swissspidy marked this conversation as resolved.
Show resolved Hide resolved

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.ACTIONS_BOT }}
branch: gh-pages
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
branch: gh-pages

repository: wp-cli/phar
swissspidy marked this conversation as resolved.
Show resolved Hide resolved

build-rpm: #------------------------------------------------------------------
name: Build RPM package
runs-on: ubuntu-latest
if: ${{ contains(github.ref, 'release') && github.repository_owner == 'wp-cli' }}
Expand Down Expand Up @@ -305,7 +352,7 @@ jobs:
branch: gh-pages
repository: wp-cli/builds

build-deb: #-----------------------------------------------------------------------
build-deb: #------------------------------------------------------------------
name: Build DEB package
runs-on: ubuntu-latest
if: ${{ contains(github.ref, 'release') && github.repository_owner == 'wp-cli' }}
Expand Down