Skip to content

Commit

Permalink
Tools: Update actions to use shared action, add commit hash to theme …
Browse files Browse the repository at this point in the history
…version.
  • Loading branch information
ryelle committed Jan 23, 2024
1 parent e702884 commit 18dd739
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0

- name: Install NodeJS
uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0
- name: Setup
uses: WordPress/wporg-repo-tools/.github/actions/setup@trunk
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install all dependencies
run: |
composer install
yarn
- name: Build
run: yarn workspaces run build
token: ${{ secrets.GITHUB_TOKEN }}

- name: Trim the repo down to just the theme
run: |
Expand All @@ -42,6 +33,12 @@ jobs:
run: |
git add * --force
- name: Append build number to version
run: |
current_version=$(grep -oP 'Version: \K[0-9]+\.[0-9]+\.[0-9]+' style.css)
new_version="${current_version}-${GITHUB_SHA::7}"
sed -i "s/Version: $current_version/Version: $new_version/" style.css
- name: Commit and push
uses: actions-js/push@a52398fac807b0c1e5f1492c969b477c8560a0ba # 1.3
with:
Expand Down

0 comments on commit 18dd739

Please sign in to comment.