Merge pull request #106 from linchpin/improve-distignore #52
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
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
name: release-please | |
jobs: | |
release-please: | |
if: github.event_name != 'pull_request' && github.event.pull_request.merged != true | |
runs-on: ubuntu-latest | |
outputs: | |
release_created: ${{ steps.release.outputs.release_created }} | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
release-type: php | |
bump-minor-pre-major: true | |
token: ${{ secrets.GH_BOT_TOKEN }} | |
versioning-strategy: always-bump-patch | |
command: manifest | |
package-name: post-type-spotlight | |
build: | |
needs: release-please | |
runs-on: ubuntu-latest | |
if: ${{ needs.release-please.outputs.release_created }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Get Version From Tag | |
id: get_version | |
uses: actions-ecosystem/[email protected] | |
with: | |
semver_only: true | |
- name: Latest Version | |
id: latest_version | |
run: | | |
TAG=${{ steps.get_version.outputs.tag }} | |
echo "VERSION=${TAG#v}" >> $GITHUB_OUTPUT | |
- name: Cache Composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/composer-cache | |
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | |
- name: Composer Install | |
uses: php-actions/composer@v6 | |
with: | |
working_dir: ./ | |
dev: no | |
php_version: 7.4 | |
- name: Build Base Plugin Assets | |
run: | | |
npm install && npm run build | |
rm -rf node_modules | |
- name: Build Blocks | |
run: | | |
cd ./blocks/ | |
npm install && npm run build | |
rm -rf node_modules | |
- name: Clean Build Files/Folders | |
run: | | |
chmod +x ./.deployment/cleanup.sh | |
sh ./.deployment/cleanup.sh; | |
- name: Create Sync Zip | |
run: | | |
cd ./zip | |
zip -r ../post-type-spotlight.zip ./ | |
cd ../ | |
- name: Upload files to a GitHub release | |
uses: svenstaro/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: post-type-spotlight.zip | |
tag: ${{ steps.get_version.outputs.tag }} | |
name: post-type-spotlight.zip | |
overwrite: true |