Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Update readme to redirect people to Gutenberg #29

Update readme to redirect people to Gutenberg

Update readme to redirect people to Gutenberg #29

name: Build Plugin ZIP
on:
push:
branches:
- main-wp-directives-plugin
jobs:
bump-version:
runs-on: ubuntu-latest
outputs:
old_version: ${{ steps.get_version.outputs.old_version }}
new_version: ${{ steps.get_version.outputs.new_version }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Compute old and new version
id: get_version
run: |
OLD_VERSION=$(jq --raw-output '.version' package.json)
echo "old_version=${OLD_VERSION}" >> $GITHUB_OUTPUT
NEW_VERSION=$(npx semver $OLD_VERSION -i patch)
echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT
- name: Configure git user name and email
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Update plugin version
env:
VERSION: ${{ steps.get_version.outputs.new_version }}
run: |
cat <<< $(jq --tab --arg version "${VERSION}" '.version = $version' package.json) > package.json
cat <<< $(jq --tab --arg version "${VERSION}" '.version = $version' package-lock.json) > package-lock.json
sed -i "s/${{ steps.get_version.outputs.old_version }}/${VERSION}/g" wp-directives.php
- name: Commit the version bump
id: commit_version_bump
run: |
git add wp-directives.php package.json package-lock.json
git commit -m "Bump plugin version to ${{ steps.get_version.outputs.new_version }}"
git push --set-upstream origin main-wp-directives-plugin
echo "version_bump_commit=$(git rev-parse --verify --short HEAD)" >> $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: bump-version
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Composer dependencies
run: composer install --no-dev
- name: Install npm dependencies
run: npm ci
- name: Build plugin
run: npm run build
- name: Create plugin ZIP file
run: npm run plugin-zip
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.bump-version.outputs.new_version }}
files: |
block-interactivity-experiments.zip