-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1097 from 10up/fix/build-stable-workflow
Update stable release workflow to account for new build process.
- Loading branch information
Showing
1 changed file
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,16 +9,27 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.4.0 | ||
uses: actions/checkout@v3.5.3 | ||
- name: Use desired version of NodeJS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
- name: Set PHP version | ||
uses: shivammathur/setup-php@2.17.0 | ||
uses: shivammathur/setup-php@2.25.4 | ||
with: | ||
php-version: 7.4 | ||
tools: composer:v2, wp | ||
|
||
- name: Clone stable branch to the release folder | ||
env: | ||
GITHUB_REPOSITORY: ${{ github.event.repository.name }} | ||
run: | | ||
git clone --depth 1 --branch stable https://github.com/$GITHUB_REPOSITORY.git release | ||
cd release | ||
git branch --show-current | ||
mv .git $RUNNER_TEMP/.git | ||
cd .. | ||
- name: Check versions | ||
run: | | ||
npm -v | ||
|
@@ -37,11 +48,14 @@ jobs: | |
GITHUB_SHA: ${{ github.event.commits[0].sha }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
cd release | ||
mv $RUNNER_TEMP/.git .git | ||
git branch --show-current | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "10upbot on GitHub" | ||
git remote set-url origin "https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git" | ||
cd release | ||
git add . | ||
git commit -m "Committing built version of $GITHUB_SHA" | ||
git push origin stable | ||
git push origin HEAD:stable |