-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update CLI to add support for changeset status * Update config * Fix schema * Fix rollup build error by sticking to 4.9.5 * Fix version for rollup * Update deps * Delete changesets * Update release.yml * Update release.yml * Rename to CHANGELOG * Update deploy-to-svn.yml * Update deploy-to-svn.yml * Update deploy-to-svn.yml * Add deploy to repo step * Add clean up command to deploy to repo * Deploy changelog and readme to repo * Fix command * Update deploy.yml * Add widget readme * Update deploy.yml * Update deploy.yml * Update deploy.yml * Add changeset to wptelegram * Create composite setup action * Checkout before run * Add shell to run steps * enable-wireit-cache
- Loading branch information
1 parent
972c27a
commit 7b30e81
Showing
35 changed files
with
525 additions
and
1,831 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
--- | ||
"wptelegram": patch | ||
--- | ||
|
||
Fixed the emojis in notifications not being sent. |
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 |
---|---|---|
|
@@ -2,13 +2,17 @@ | |
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": [ | ||
"@changesets/changelog-github", | ||
{ "repo": "wpsocio/wp-plugins-dev" } | ||
{ "repo": "irshadahmad21/wp-plugins-dev-test" } | ||
], | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "restricted", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"privatePackages": { | ||
"tag": true, | ||
"version": true | ||
}, | ||
"ignore": [] | ||
} |
This file was deleted.
Oops, something went wrong.
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,110 @@ | ||
name: Deploy | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
tag: | ||
name: New release | ||
needs: [details] | ||
runs-on: ubuntu-latest | ||
if: ${{ fromJson(needs.details.outputs.result).shouldDeploy }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Environment | ||
uses: ./actions/setup | ||
with: | ||
lockfile: pnpm-hashed.lock | ||
enable-wireit-cache: true | ||
|
||
- name: Prepare bundle | ||
run: | | ||
pnpm wpdev bundle ${{ fromJson(needs.details.outputs.result).name }} | ||
- name: Upload release assets | ||
uses: AButler/[email protected] | ||
with: | ||
# e.g. dist/plugin-name-1.0.0.zip | ||
files: "dist/${{ fromJson(needs.details.outputs.result).name }}-${{ fromJson(needs.details.outputs.result).version }}.zip" | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Deploy to WordPress.org | ||
id: deploy | ||
uses: 10up/action-wordpress-plugin-deploy@stable | ||
with: | ||
dry-run: true | ||
env: | ||
SLUG: ${{ fromJson(needs.details.outputs.result).name }} | ||
VERSION: ${{ fromJson(needs.details.outputs.result).version }} | ||
BUILD_DIR: "dist/${{ fromJson(needs.details.outputs.result).name }}" | ||
ASSETS_DIR: "${{ fromJson(needs.details.outputs.result).path }}/.wordpress-org" | ||
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}test | ||
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}test | ||
|
||
- name: Copy README.md to dist | ||
run: | | ||
cp ${{ fromJson(needs.details.outputs.result).path }}/README.md dist/${{ fromJson(needs.details.outputs.result).name }}/README.md | ||
- name: Deploy to repo | ||
uses: manzoorwanijk/action-deploy-to-repo@v3 | ||
with: | ||
src_dir: dist/${{ fromJson(needs.details.outputs.result).name }} | ||
target_repo: ${{ github.repository_owner }}/${{ fromJson(needs.details.outputs.result).name }} | ||
target_dir: "." | ||
target_branch: main | ||
access_token: ${{ secrets.GH_ACCESS_TOKEN }} | ||
# Remove everything from the target repo before deploying | ||
cleanup_command: git rm -rf . && git clean -fxd | ||
|
||
details: | ||
name: Get details | ||
runs-on: ubuntu-latest | ||
outputs: | ||
result: ${{ steps.details.outputs.result }} | ||
steps: | ||
- name: Get release details | ||
uses: actions/github-script@v7 | ||
id: details | ||
with: | ||
script: | | ||
const tagRegex = /^(?<name>.+)@(?<version>[^@]+)$/; | ||
const result = '${{ github.event.release.tag_name }}'.match(tagRegex); | ||
if (!result) { | ||
throw new Error('Invalid tag name: ${{ github.event.release.tag_name }}'); | ||
} | ||
const { name, version } = result.groups; | ||
const plugins = [ | ||
'wptelegram', | ||
'wptelegram-comments', | ||
'wptelegram-login', | ||
'wptelegram-widget', | ||
]; | ||
const themes = []; | ||
const toDeploy = [...plugins, ...themes]; | ||
const belongsTo = plugins.includes(name) | ||
? 'plugins' | ||
: themes.includes(name) | ||
? 'themes' | ||
: ''; | ||
const path = [belongsTo, name].filter(Boolean).join('/'); | ||
const shouldDeploy = toDeploy.includes(name); | ||
return { name, version, path, shouldDeploy }; | ||
- name: Print details | ||
run: | | ||
echo "Package details: ${{ steps.details.outputs.result }}" |
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,34 @@ | ||
name: Prepare or publish release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
release: | ||
name: Prepare or publish release | ||
if: github.repository == 'irshadahmad21/wp-plugins-dev-test' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Environment | ||
uses: ./actions/setup | ||
with: | ||
lockfile: pnpm-hashed.lock | ||
enable-wireit-cache: true | ||
|
||
- name: Create Release Pull Request or Publish | ||
uses: changesets/action@v1 | ||
id: changesets | ||
with: | ||
publish: pnpm release | ||
version: pnpm prep-version | ||
title: Prepare for next release | ||
commit: Prepare for next release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} |
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,87 @@ | ||
name: "Setup Node, pnpm, PHP, WP CLI and install dependencies" | ||
description: "This action checks out the commit, sets up Node, pnpm, PHP, WP CLI and installs dependencies." | ||
author: "wpsocio" | ||
inputs: | ||
cache-key: | ||
required: false | ||
description: "Cache busting key. If this changes, the cache will be busted." | ||
default: "1" | ||
|
||
node-version: | ||
required: false | ||
description: "The version of Node to use." | ||
default: "lts/*" | ||
|
||
php-version: | ||
required: false | ||
description: "The version of PHP to use." | ||
default: "8" | ||
|
||
pnpm-version: | ||
required: false | ||
description: "The version of pnpm to use." | ||
default: "latest" | ||
|
||
lockfile: | ||
required: false | ||
description: "The lockfile to use." | ||
default: "pnpm-lock.yaml" | ||
|
||
enable-wireit-cache: | ||
required: false | ||
description: "Enable Wireit cache." | ||
default: "false" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
|
||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: ${{ inputs.pnpm-version }} | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: | | ||
${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-modules-${{ inputs.cache-key }}-${{ hashFiles( inputs.lockfile ) }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Wireit cache | ||
if: ${{ inputs.enable-wireit-cache == 'true' }} | ||
uses: google/wireit@setup-github-actions-caching/v1 | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: pnpm install | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ inputs.php-version }} | ||
tools: phpcs | ||
|
||
- name: Install gettext | ||
shell: bash | ||
run: sudo apt install gettext | ||
|
||
- name: Setup WP-CLI | ||
shell: bash | ||
run: | | ||
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | ||
chmod +x wp-cli.phar | ||
sudo mv wp-cli.phar /usr/local/bin/wp | ||
# Check WP-CLI | ||
wp --info |
Oops, something went wrong.