-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade workflows for repo and allow for version updates/prep
- Loading branch information
1 parent
8ad793c
commit f7e01f4
Showing
4 changed files
with
175 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Prepare Release Branch | ||
env: | ||
PR_PREFIX: 'Pods Gravity Forms ' | ||
PR_LABELS: 'Type: Release' | ||
MILESTONE_PREFIX: 'Pods Gravity Forms ' | ||
BRANCH_PREFIX: 'release/' | ||
WPORG_PLUGIN_FILE: 'pods-gravity-forms.php' | ||
WPORG_PLUGIN_VERSION_CONSTANT_NAME: 'PODS_GF_VERSION' | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
new_plugin_version: | ||
description: 'New plugin version (without the "-a-1"), defaults to the next incremental version from package.json' | ||
required: false | ||
version_increment: | ||
description: 'OR Version increment scheme (if incrementing the package.json version; patch=x.x.x, minor=x.x, major=x.0)' | ||
required: true | ||
type: choice | ||
default: 'patch' | ||
options: | ||
- 'major' | ||
- 'minor' | ||
- 'patch' | ||
jobs: | ||
prepare_release_branch: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GH_BOT_PUSH }} | ||
- name: Maybe use the version number from inputs | ||
if: ${{ github.event.inputs.new_plugin_version != null && github.event.inputs.new_plugin_version != '' }} | ||
shell: bash | ||
run: | | ||
echo "PLUGIN_VERSION=${{ github.event.inputs.new_plugin_version }}" >> $GITHUB_ENV | ||
- name: Maybe lookup the version number from package.json | ||
id: version-lookup | ||
if: ${{ github.event.inputs.new_plugin_version == null || github.event.inputs.new_plugin_version == '' }} | ||
shell: bash | ||
run: | | ||
echo "CURRENT_VERSION=$(jq -r .version package.json)" >> $GITHUB_OUTPUT | ||
- name: Maybe get the next version information | ||
if: ${{ steps.version-lookup.outputs.CURRENT_VERSION != null && steps.version-lookup.outputs.CURRENT_VERSION != '' }} | ||
uses: reecetech/[email protected] | ||
id: version-increment | ||
with: | ||
scheme: semver | ||
increment: ${{ github.event.inputs.version_increment }} | ||
- name: Maybe store the next version | ||
if: ${{ steps.version-increment.outputs.version != null && steps.version-increment.outputs.version != '' }} | ||
shell: bash | ||
run: | | ||
echo "PLUGIN_VERSION=${{ steps.version-increment.outputs.version }}" >> $GITHUB_ENV | ||
- name: What are we doing? | ||
run: | | ||
echo PLUGIN_VERSION: ${{ env.PLUGIN_VERSION }} | ||
- name: Run wporg-replace | ||
uses: sc0ttkclark/[email protected] | ||
with: | ||
plugin_version: '${{ env.PLUGIN_VERSION }}-a-1' | ||
plugin_version_constant_name: ${{ env.WPORG_PLUGIN_VERSION_CONSTANT_NAME }} | ||
plugin_file: ${{ env.WPORG_PLUGIN_FILE }} | ||
plugin_path: ${{ github.workspace }} | ||
- name: Create Milestone | ||
id: create-milestone | ||
uses: WyriHaximus/[email protected] | ||
continue-on-error: true | ||
with: | ||
title: '${{ env.MILESTONE_PREFIX }}${{ env.PLUGIN_VERSION }}' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_BOT_PUSH }} | ||
- name: Create Pull Request | ||
id: create-pull-request | ||
uses: peter-evans/[email protected] | ||
with: | ||
token: ${{ secrets.GH_BOT_PUSH }} | ||
branch: '${{ env.BRANCH_PREFIX }}${{ env.PLUGIN_VERSION }}' | ||
commit-message: 'Set version to ${{ env.PLUGIN_VERSION }}-a-1' | ||
title: '${{ env.PR_PREFIX }}${{ env.PLUGIN_VERSION }}' | ||
labels: ${{ env.PR_LABELS }} | ||
assignees: ${{ github.actor }} | ||
milestone: ${{ steps.create-milestone.outputs.number }} | ||
draft: true |
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
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: WordPress.org Update Versions | ||
env: | ||
WPORG_PLUGIN_FILE: 'pods-gravity-forms.php' | ||
WPORG_PLUGIN_VERSION_CONSTANT_NAME: 'PODS_GF_VERSION' | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
plugin_version: | ||
description: 'Plugin version' | ||
required: false | ||
tested_wp_version: | ||
description: 'Tested up to WP version' | ||
required: false | ||
minimum_wp_version: | ||
description: 'Minimum WP version' | ||
required: false | ||
minimum_php_version: | ||
description: 'Minimum PHP version' | ||
required: false | ||
minimum_mysql_version: | ||
description: 'Minimum MySQL version' | ||
required: false | ||
pull_request: | ||
paths: | ||
- 'package.json' | ||
jobs: | ||
wporg_replace: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: What are we doing? | ||
run: | | ||
echo plugin_version: ${{ github.event.inputs.plugin_version }} | ||
echo tested_wp_version: ${{ github.event.inputs.tested_wp_version }} | ||
echo minimum_wp_version: ${{ github.event.inputs.minimum_wp_version }} | ||
echo minimum_php_version: ${{ github.event.inputs.minimum_php_version }} | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GH_BOT_PUSH }} | ||
- name: Check the version number from package.json | ||
shell: bash | ||
run: echo "PLUGIN_VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV | ||
- name: Run wporg-replace | ||
uses: sc0ttkclark/[email protected] | ||
with: | ||
plugin_version: ${{ (github.event.inputs.plugin_version != '') && github.event.inputs.plugin_version || env.PLUGIN_VERSION }} | ||
plugin_version_constant_name: ${{ env.WPORG_PLUGIN_VERSION_CONSTANT_NAME }} | ||
tested_wp_version: ${{ github.event.inputs.tested_wp_version }} | ||
minimum_wp_version: ${{ github.event.inputs.minimum_wp_version }} | ||
minimum_php_version: ${{ github.event.inputs.minimum_php_version }} | ||
plugin_file: ${{ env.WPORG_PLUGIN_FILE }} | ||
plugin_path: ${{ github.workspace }} | ||
- name: Commit changes | ||
id: auto-commit-action | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
file_pattern: ${{ env.WPORG_PLUGIN_FILE }} readme.txt package.json | ||
commit_message: Update wporg version(s) | ||
- name: "Run if changes have been detected" | ||
if: steps.auto-commit-action.outputs.changes_detected == 'true' | ||
run: echo "Changes!" | ||
- name: "Run if no changes have been detected" | ||
if: steps.auto-commit-action.outputs.changes_detected == 'false' | ||
run: echo "No Changes!" |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "pods-gravity-forms", | ||
"version": "1.4.5", | ||
"description": "PIntegration with Gravity Forms; Provides a UI for mapping a Form's submissions into a Pod.", | ||
"author": "Pods Foundation, Inc", | ||
"homepage": "https://pods.io/", | ||
"bugs": "https://github.com/pods-framework/pods-gravity-forms/issues", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/pods-framework/pods-gravity-forms.git" | ||
}, | ||
"support": "https://support.pods.io/", | ||
"funding": { | ||
"type": "individual", | ||
"url": "https://friends.pods.io/" | ||
}, | ||
"license": "GPL-2.0+", | ||
"contributors": "https://github.com/pods-framework/pods-gravity-forms/graphs/contributors" | ||
} |