diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbd7d5f2..97366381 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: | @@ -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: