From 134c3ac856bf1852a289cd3d7dea25c3a6356664 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Tue, 27 Jan 2026 16:44:43 -0300 Subject: [PATCH 01/13] chore: deprecate circleci --- .circleci/config.yml | 122 ---------------------- .github/workflows/build-and-test.yml | 23 ++++ .github/workflows/build-distributable.yml | 14 +++ .github/workflows/i18n.yml | 14 +++ .github/workflows/php.yml | 19 ++++ .github/workflows/release.yml | 55 ++++++++++ 6 files changed, 125 insertions(+), 122 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/build-and-test.yml create mode 100644 .github/workflows/build-distributable.yml create mode 100644 .github/workflows/i18n.yml create mode 100644 .github/workflows/php.yml create mode 100644 .github/workflows/release.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a67112aac..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,122 +0,0 @@ -version: 2.1 - -orbs: - newspack: newspack/newspack@1.5.8 - -commands: - checkout_code: - steps: - - checkout - - attach_workspace: - at: ~/ - -jobs: - build: - docker: - - image: cimg/node:lts - steps: - - checkout_code - - run: - name: Install dependencies - command: npm ci - - persist_to_workspace: - root: ~/ - paths: - - project - - # Build distributable ZIP files. - build_distributables: - docker: - - image: cimg/node:lts - steps: - - checkout_code - - run: - name: Build theme ZIPs - command: npm run build && npm run release:archive - - store_artifacts: - path: release/newspack-joseph.zip - - store_artifacts: - path: release/newspack-katharine.zip - - store_artifacts: - path: release/newspack-nelson.zip - - store_artifacts: - path: release/newspack-sacha.zip - - store_artifacts: - path: release/newspack-scott.zip - - store_artifacts: - path: release/newspack-theme.zip - - # Linting - lint: - docker: - - image: cimg/node:lts - steps: - - checkout_code - - run: - name: Run Linter - command: npm run lint - - # Release job - release: - docker: - - image: cimg/node:lts - steps: - - checkout_code - - run: - name: Release new version - command: npm run release - - persist_to_workspace: - root: ~/ - paths: - - project - - # Reset alpha branch after a release and publish child themes' releases - post_release: - docker: - - image: cimg/node:lts - steps: - - checkout_code - - run: - name: Publish child themes' releases - command: node scripts/create-child-releases.js --run - - run: - name: Perform post-release chores - command: ./node_modules/newspack-scripts/post-release.sh - -workflows: - version: 2 - all: - jobs: - - build - - newspack/i18n: - requires: - - build - filters: - branches: - only: - - trunk - - lint: - requires: - - build - - release: - requires: - - build - filters: - branches: - only: - - release - - alpha - - /^hotfix\/.*/ - - /^epic\/.*/ - - build_distributables: - requires: - - build - # Running this after release ensure the version number in files will be correct. - - release - - post_release: - requires: - - release - filters: - branches: - only: - - release diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 000000000..f1accd79b --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,23 @@ +name: Build and Test + +on: + pull_request: + push: + branches: + - trunk + - release + - alpha + - 'hotfix/**' + - 'epic/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + uses: Automattic/newspack-scripts/.github/workflows/reusable-build.yml@refactor/deprecate-circle-ci + + lint-js-scss: + needs: build + uses: Automattic/newspack-scripts/.github/workflows/reusable-lint-js-scss.yml@refactor/deprecate-circle-ci diff --git a/.github/workflows/build-distributable.yml b/.github/workflows/build-distributable.yml new file mode 100644 index 000000000..8fbc0c970 --- /dev/null +++ b/.github/workflows/build-distributable.yml @@ -0,0 +1,14 @@ +name: Build distributable + +on: + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-distributable: + uses: Automattic/newspack-scripts/.github/workflows/reusable-build-distributable.yml@refactor/deprecate-circle-ci + with: + archive-name: newspack-theme diff --git a/.github/workflows/i18n.yml b/.github/workflows/i18n.yml new file mode 100644 index 000000000..e2d4788d2 --- /dev/null +++ b/.github/workflows/i18n.yml @@ -0,0 +1,14 @@ +name: Internationalization + +on: + push: + branches: + - trunk + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + i18n: + uses: Automattic/newspack-scripts/.github/workflows/reusable-i18n.yml@refactor/deprecate-circle-ci diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 000000000..7e0ec45d2 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,19 @@ +name: PHP + +on: + pull_request: + push: + branches: + - trunk + - release + - alpha + - 'hotfix/**' + - 'epic/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint-php: + uses: Automattic/newspack-scripts/.github/workflows/reusable-lint-php.yml@refactor/deprecate-circle-ci diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..83570362c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +name: Release + +on: + push: + branches: + - release + - alpha + - 'hotfix/**' + - 'epic/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + uses: Automattic/newspack-scripts/.github/workflows/reusable-build.yml@refactor/deprecate-circle-ci + + release: + needs: build + uses: Automattic/newspack-scripts/.github/workflows/reusable-release.yml@refactor/deprecate-circle-ci + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + publish-child-releases: + if: github.ref == 'refs/heads/release' + needs: release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + + - name: Install dependencies + run: npm ci --legacy-peer-deps + + - name: Build and create archives + run: npm run build && npm run release:archive + + - name: Publish child themes releases + run: node scripts/create-child-releases.js --run + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + post-release: + if: github.ref == 'refs/heads/release' + needs: release + uses: Automattic/newspack-scripts/.github/workflows/reusable-post-release.yml@refactor/deprecate-circle-ci From 1e8354796af061791758c196c2e18955591b4b1e Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Tue, 27 Jan 2026 16:45:11 -0300 Subject: [PATCH 02/13] chore(deps): update newspack-scripts dependency to use GitHub repository --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index cb353fdca..398004b52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22652,8 +22652,8 @@ }, "node_modules/newspack-scripts": { "version": "5.8.0", - "resolved": "https://registry.npmjs.org/newspack-scripts/-/newspack-scripts-5.8.0.tgz", - "integrity": "sha512-INOymPHxavzLFziqa9zcfB9KRfi9w+FOwq1cNj8IKnfBSlWrYMLsw43LMgAk7wrGtv6crvHEREweHhPGWMAtGQ==", + "resolved": "git+ssh://git@github.com/Automattic/newspack-scripts.git#1b654fae0446656ac8221ae7400a42bbd80b2140", + "integrity": "sha512-NzUACVvKJJLiYXtFIHmxZNzVsqmYJmW0HuzUpNa3Y/pJEUK1QfqWk+SCACTyDx7zXoNlIvjBTbNUD6R1zSF72w==", "dev": true, "license": "ISC", "dependencies": { From 2ce2e52721512f1c0b9177522b4bf3fa7eca29ad Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Tue, 27 Jan 2026 17:00:32 -0300 Subject: [PATCH 03/13] refactor: update build workflow to create and upload theme ZIPs --- .github/workflows/build-distributable.yml | 56 +++++++++++++++++++++-- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-distributable.yml b/.github/workflows/build-distributable.yml index 8fbc0c970..fc2bcd2d8 100644 --- a/.github/workflows/build-distributable.yml +++ b/.github/workflows/build-distributable.yml @@ -9,6 +9,56 @@ concurrency: jobs: build-distributable: - uses: Automattic/newspack-scripts/.github/workflows/reusable-build-distributable.yml@refactor/deprecate-circle-ci - with: - archive-name: newspack-theme + name: Build theme ZIPs + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + + - name: Install dependencies + run: npm ci --legacy-peer-deps + + - name: Build and create archives + run: npm run build && npm run release:archive + + - name: Upload newspack-theme + uses: actions/upload-artifact@v4 + with: + name: newspack-theme + path: release/newspack-theme.zip + + - name: Upload newspack-joseph + uses: actions/upload-artifact@v4 + with: + name: newspack-joseph + path: release/newspack-joseph.zip + + - name: Upload newspack-katharine + uses: actions/upload-artifact@v4 + with: + name: newspack-katharine + path: release/newspack-katharine.zip + + - name: Upload newspack-nelson + uses: actions/upload-artifact@v4 + with: + name: newspack-nelson + path: release/newspack-nelson.zip + + - name: Upload newspack-sacha + uses: actions/upload-artifact@v4 + with: + name: newspack-sacha + path: release/newspack-sacha.zip + + - name: Upload newspack-scott + uses: actions/upload-artifact@v4 + with: + name: newspack-scott + path: release/newspack-scott.zip From 3a37d43cb163eae0f0b85915053494cfca4b0bbd Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Wed, 28 Jan 2026 09:53:08 -0300 Subject: [PATCH 04/13] feat: test gh release action --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83570362c..55de899bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,6 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} publish-child-releases: - if: github.ref == 'refs/heads/release' needs: release runs-on: ubuntu-latest steps: From 716b3c50e1f8050dfc11b20e2db6af0d109e2789 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 28 Jan 2026 12:55:29 +0000 Subject: [PATCH 05/13] chore(release): 2.18.0-hotfix-test-gh-action.1 [skip ci] # [2.18.0-hotfix-test-gh-action.1](https://github.com/Automattic/newspack-theme/compare/v2.17.0...v2.18.0-hotfix-test-gh-action.1) (2026-01-28) ### Features * test gh release action ([3a37d43](https://github.com/Automattic/newspack-theme/commit/3a37d43cb163eae0f0b85915053494cfca4b0bbd)) --- CHANGELOG.md | 7 +++++++ newspack-joseph/sass/theme-description.scss | 2 +- newspack-katharine/sass/theme-description.scss | 2 +- newspack-nelson/sass/theme-description.scss | 2 +- newspack-sacha/sass/theme-description.scss | 2 +- newspack-scott/sass/theme-description.scss | 2 +- newspack-theme/sass/theme-description.scss | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 9 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c39d91f14..7542e7abc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [2.18.0-hotfix-test-gh-action.1](https://github.com/Automattic/newspack-theme/compare/v2.17.0...v2.18.0-hotfix-test-gh-action.1) (2026-01-28) + + +### Features + +* test gh release action ([3a37d43](https://github.com/Automattic/newspack-theme/commit/3a37d43cb163eae0f0b85915053494cfca4b0bbd)) + # [2.17.0](https://github.com/Automattic/newspack-theme/compare/v2.16.0...v2.17.0) (2026-01-19) diff --git a/newspack-joseph/sass/theme-description.scss b/newspack-joseph/sass/theme-description.scss index 0da49f5d0..6869c73a9 100644 --- a/newspack-joseph/sass/theme-description.scss +++ b/newspack-joseph/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.17.0 +Version: 2.18.0-hotfix-test-gh-action.1 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-katharine/sass/theme-description.scss b/newspack-katharine/sass/theme-description.scss index ac34a972b..265f5e167 100644 --- a/newspack-katharine/sass/theme-description.scss +++ b/newspack-katharine/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.17.0 +Version: 2.18.0-hotfix-test-gh-action.1 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-nelson/sass/theme-description.scss b/newspack-nelson/sass/theme-description.scss index b429dd8a0..224b5d645 100644 --- a/newspack-nelson/sass/theme-description.scss +++ b/newspack-nelson/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.17.0 +Version: 2.18.0-hotfix-test-gh-action.1 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-sacha/sass/theme-description.scss b/newspack-sacha/sass/theme-description.scss index 085990256..0c02cb939 100644 --- a/newspack-sacha/sass/theme-description.scss +++ b/newspack-sacha/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.17.0 +Version: 2.18.0-hotfix-test-gh-action.1 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-scott/sass/theme-description.scss b/newspack-scott/sass/theme-description.scss index 89398abe0..b3d0e11f2 100644 --- a/newspack-scott/sass/theme-description.scss +++ b/newspack-scott/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.17.0 +Version: 2.18.0-hotfix-test-gh-action.1 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-theme/sass/theme-description.scss b/newspack-theme/sass/theme-description.scss index 77a87d3ca..205ce7a16 100644 --- a/newspack-theme/sass/theme-description.scss +++ b/newspack-theme/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.17.0 +Version: 2.18.0-hotfix-test-gh-action.1 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: newspack-theme diff --git a/package-lock.json b/package-lock.json index 398004b52..d9da4f681 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "newspack", - "version": "2.17.0", + "version": "2.18.0-hotfix-test-gh-action.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "newspack", - "version": "2.17.0", + "version": "2.18.0-hotfix-test-gh-action.1", "devDependencies": { "@octokit/rest": "^20.1.2", "chokidar-cli": "^3.0.0", diff --git a/package.json b/package.json index 283fd3b18..d75200c6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "newspack", - "version": "2.17.0", + "version": "2.18.0-hotfix-test-gh-action.1", "description": "A theme for Newspack. https://newspack.com", "bugs": { "url": "https://github.com/Automattic/newspack-theme/issues" From 407603e44621c8de3317b17dca5404951cbf7d20 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Wed, 28 Jan 2026 11:19:31 -0300 Subject: [PATCH 06/13] refactor: update release workflow and remove child release script - Replaced the child release script with a reusable workflow for syncing releases. - Updated the release configuration to define themes directly in the .releaserc.js file. - Removed the deprecated publish-child-releases job from the GitHub Actions workflow. --- .github/workflows/release.yml | 26 ------ .github/workflows/reusable-sync-release.yml | 63 +++++++++++++ .releaserc.js | 11 ++- scripts/create-child-releases.js | 98 --------------------- 4 files changed, 71 insertions(+), 127 deletions(-) create mode 100644 .github/workflows/reusable-sync-release.yml delete mode 100644 scripts/create-child-releases.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 55de899bd..ba074e4ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,32 +22,6 @@ jobs: secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - publish-child-releases: - needs: release - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: 'npm' - - - name: Install dependencies - run: npm ci --legacy-peer-deps - - - name: Build and create archives - run: npm run build && npm run release:archive - - - name: Publish child themes releases - run: node scripts/create-child-releases.js --run - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - post-release: if: github.ref == 'refs/heads/release' needs: release diff --git a/.github/workflows/reusable-sync-release.yml b/.github/workflows/reusable-sync-release.yml new file mode 100644 index 000000000..2e97e17fc --- /dev/null +++ b/.github/workflows/reusable-sync-release.yml @@ -0,0 +1,63 @@ +name: Sync Release + +on: + workflow_call: + inputs: + theme: + description: 'Theme name (e.g., newspack-joseph)' + required: true + type: string + +jobs: + sync-release: + runs-on: ubuntu-latest + steps: + - name: Get latest release from newspack-theme + id: upstream + env: + GH_TOKEN: ${{ github.token }} + run: | + LATEST=$(gh release view --repo Automattic/newspack-theme --json tagName,name,body -q '.') + TAG=$(echo "$LATEST" | jq -r '.tagName') + NAME=$(echo "$LATEST" | jq -r '.name') + BODY=$(echo "$LATEST" | jq -r '.body') + echo "tag=$TAG" >> $GITHUB_OUTPUT + echo "name=$NAME" >> $GITHUB_OUTPUT + # Handle multiline body + { + echo 'body<> $GITHUB_OUTPUT + + - name: Check if release already exists + id: check + env: + GH_TOKEN: ${{ github.token }} + run: | + if gh release view "${{ steps.upstream.outputs.tag }}" --repo ${{ github.repository }} > /dev/null 2>&1; then + echo "exists=true" >> $GITHUB_OUTPUT + else + echo "exists=false" >> $GITHUB_OUTPUT + fi + + - name: Download theme ZIP from upstream release + if: steps.check.outputs.exists == 'false' + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release download "${{ steps.upstream.outputs.tag }}" \ + --repo Automattic/newspack-theme \ + --pattern "${{ inputs.theme }}.zip" \ + --dir . + + - name: Create release + if: steps.check.outputs.exists == 'false' + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release create "${{ steps.upstream.outputs.tag }}" \ + --repo ${{ github.repository }} \ + --title "${{ steps.upstream.outputs.name }}" \ + --notes "${{ steps.upstream.outputs.body }}" \ + "${{ inputs.theme }}.zip" diff --git a/.releaserc.js b/.releaserc.js index fda7d12f8..b896672a1 100644 --- a/.releaserc.js +++ b/.releaserc.js @@ -1,6 +1,11 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ - -const { THEMES } = require( './scripts/create-child-releases.js' ); +const THEMES = [ + 'newspack-theme', + 'newspack-joseph', + 'newspack-katharine', + 'newspack-nelson', + 'newspack-sacha', + 'newspack-scott', +]; module.exports = { branches: [ diff --git a/scripts/create-child-releases.js b/scripts/create-child-releases.js deleted file mode 100644 index 0da4f82a8..000000000 --- a/scripts/create-child-releases.js +++ /dev/null @@ -1,98 +0,0 @@ -/* eslint-disable no-console, @typescript-eslint/no-var-requires */ - -const { basename, resolve } = require( 'path' ); -const { stat, readFile } = require( 'fs-extra' ); -const { Octokit } = require( '@octokit/rest' ); - -const THEMES = [ - 'newspack-theme', - 'newspack-joseph', - 'newspack-katharine', - 'newspack-nelson', - 'newspack-sacha', - 'newspack-scott', -]; - -/** - * Because all the themes are in a monorepo, some internal processes - * have a hard time automatically deploying the changes. For this reason - * the themes have individual repos just for the releases. - * These releases are automatically published using this script. - */ -const createExternalReleasesOfThemes = async () => { - const { version } = require( '../package.json' ); - - const TOKEN = process.env.GITHUB_TOKEN || process.env.GH_TOKEN; - - if ( ! TOKEN ) { - console.error( 'Missing github token.' ); - process.exit( 1 ); - } - - const octokit = new Octokit( { - auth: TOKEN, - request: { - fetch, - }, - } ); - - const RELEASES = THEMES.map( name => ( { - filePath: resolve( __dirname, `../release/${ name }.zip` ), - repoName: `${ name }-theme`, - } ) ); - - const owner = 'Automattic'; - - RELEASES.forEach( async ( { filePath, repoName } ) => { - console.log( `Crating a release for ${ owner }/${ repoName }…` ); - - const { - data: { upload_url: uploadUrl, id: releaseId }, - } = await octokit.repos.createRelease( { - owner, - repo: repoName, - tag_name: `v${ version }`, - name: `v${ version }`, - body: `Release v${ version }`, - // We'll create a draft release, append the assets to it, and then publish it. - // This is so that the assets are available when we get a Github release event. - draft: true, - } ); - - const file = await stat( resolve( filePath ) ); - const upload = { - url: uploadUrl, - data: await readFile( filePath ), - name: basename( filePath ), - headers: { - 'content-type': 'application/zip', - 'content-length': file.size, - }, - }; - - const { - data: { browser_download_url: downloadUrl }, - } = await octokit.repos.uploadReleaseAsset( upload ); - - console.log( `Published file ${ downloadUrl }` ); - const { - data: { html_url: url }, - } = await octokit.repos.updateRelease( { - owner, - repo: repoName, - release_id: releaseId, - draft: false, - } ); - - console.log( `Published GitHub release: ${ url }` ); - } ); -}; - -if ( process.argv.some( arg => arg.startsWith( '--run' ) ) ) { - createExternalReleasesOfThemes(); -} - -// Export for use of semantic-release config. -module.exports = { - THEMES, -}; From 23c06f3935226118f5880dc9e58c9deab88b7db8 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Wed, 28 Jan 2026 11:28:04 -0300 Subject: [PATCH 07/13] fix: enhance release workflow to handle pre-releases - Updated the workflow to fetch the latest release, including pre-releases. - Added logic to conditionally create a pre-release based on the fetched release information. - Improved body fetching for releases to ensure accurate content retrieval. --- .github/workflows/reusable-sync-release.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-sync-release.yml b/.github/workflows/reusable-sync-release.yml index 2e97e17fc..948586339 100644 --- a/.github/workflows/reusable-sync-release.yml +++ b/.github/workflows/reusable-sync-release.yml @@ -17,12 +17,16 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - LATEST=$(gh release view --repo Automattic/newspack-theme --json tagName,name,body -q '.') + # Get latest release (including pre-releases) + LATEST=$(gh release list --repo Automattic/newspack-theme --limit 1 --json tagName,name,isPrerelease -q '.[0]') TAG=$(echo "$LATEST" | jq -r '.tagName') NAME=$(echo "$LATEST" | jq -r '.name') - BODY=$(echo "$LATEST" | jq -r '.body') + IS_PRERELEASE=$(echo "$LATEST" | jq -r '.isPrerelease') + # Fetch body separately + BODY=$(gh release view "$TAG" --repo Automattic/newspack-theme --json body -q '.body') echo "tag=$TAG" >> $GITHUB_OUTPUT echo "name=$NAME" >> $GITHUB_OUTPUT + echo "prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT # Handle multiline body { echo 'body< Date: Wed, 28 Jan 2026 14:30:12 +0000 Subject: [PATCH 08/13] chore(release): 2.18.0-hotfix-test-gh-action.2 [skip ci] # [2.18.0-hotfix-test-gh-action.2](https://github.com/Automattic/newspack-theme/compare/v2.18.0-hotfix-test-gh-action.1...v2.18.0-hotfix-test-gh-action.2) (2026-01-28) ### Bug Fixes * enhance release workflow to handle pre-releases ([23c06f3](https://github.com/Automattic/newspack-theme/commit/23c06f3935226118f5880dc9e58c9deab88b7db8)) --- CHANGELOG.md | 7 +++++++ newspack-joseph/sass/theme-description.scss | 2 +- newspack-katharine/sass/theme-description.scss | 2 +- newspack-nelson/sass/theme-description.scss | 2 +- newspack-sacha/sass/theme-description.scss | 2 +- newspack-scott/sass/theme-description.scss | 2 +- newspack-theme/sass/theme-description.scss | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 9 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7542e7abc..50c48b495 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [2.18.0-hotfix-test-gh-action.2](https://github.com/Automattic/newspack-theme/compare/v2.18.0-hotfix-test-gh-action.1...v2.18.0-hotfix-test-gh-action.2) (2026-01-28) + + +### Bug Fixes + +* enhance release workflow to handle pre-releases ([23c06f3](https://github.com/Automattic/newspack-theme/commit/23c06f3935226118f5880dc9e58c9deab88b7db8)) + # [2.18.0-hotfix-test-gh-action.1](https://github.com/Automattic/newspack-theme/compare/v2.17.0...v2.18.0-hotfix-test-gh-action.1) (2026-01-28) diff --git a/newspack-joseph/sass/theme-description.scss b/newspack-joseph/sass/theme-description.scss index 6869c73a9..c88b59b0e 100644 --- a/newspack-joseph/sass/theme-description.scss +++ b/newspack-joseph/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.1 +Version: 2.18.0-hotfix-test-gh-action.2 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-katharine/sass/theme-description.scss b/newspack-katharine/sass/theme-description.scss index 265f5e167..caa304c26 100644 --- a/newspack-katharine/sass/theme-description.scss +++ b/newspack-katharine/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.1 +Version: 2.18.0-hotfix-test-gh-action.2 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-nelson/sass/theme-description.scss b/newspack-nelson/sass/theme-description.scss index 224b5d645..d485e1aba 100644 --- a/newspack-nelson/sass/theme-description.scss +++ b/newspack-nelson/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.1 +Version: 2.18.0-hotfix-test-gh-action.2 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-sacha/sass/theme-description.scss b/newspack-sacha/sass/theme-description.scss index 0c02cb939..fa48e5407 100644 --- a/newspack-sacha/sass/theme-description.scss +++ b/newspack-sacha/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.1 +Version: 2.18.0-hotfix-test-gh-action.2 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-scott/sass/theme-description.scss b/newspack-scott/sass/theme-description.scss index b3d0e11f2..ce9430508 100644 --- a/newspack-scott/sass/theme-description.scss +++ b/newspack-scott/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.1 +Version: 2.18.0-hotfix-test-gh-action.2 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-theme/sass/theme-description.scss b/newspack-theme/sass/theme-description.scss index 205ce7a16..776fc85f2 100644 --- a/newspack-theme/sass/theme-description.scss +++ b/newspack-theme/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.1 +Version: 2.18.0-hotfix-test-gh-action.2 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: newspack-theme diff --git a/package-lock.json b/package-lock.json index d9da4f681..a75ea460a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "newspack", - "version": "2.18.0-hotfix-test-gh-action.1", + "version": "2.18.0-hotfix-test-gh-action.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "newspack", - "version": "2.18.0-hotfix-test-gh-action.1", + "version": "2.18.0-hotfix-test-gh-action.2", "devDependencies": { "@octokit/rest": "^20.1.2", "chokidar-cli": "^3.0.0", diff --git a/package.json b/package.json index d75200c6b..742628d50 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "newspack", - "version": "2.18.0-hotfix-test-gh-action.1", + "version": "2.18.0-hotfix-test-gh-action.2", "description": "A theme for Newspack. https://newspack.com", "bugs": { "url": "https://github.com/Automattic/newspack-theme/issues" From a97f58d6383e0d2a2968e68660021c2ed2420437 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Wed, 28 Jan 2026 11:58:01 -0300 Subject: [PATCH 09/13] Revert "chore(release): 2.18.0-hotfix-test-gh-action.2 [skip ci]" This reverts commit 538f393a71b28d2339e815a662bd3eaa13ca507b. --- CHANGELOG.md | 7 ------- newspack-joseph/sass/theme-description.scss | 2 +- newspack-katharine/sass/theme-description.scss | 2 +- newspack-nelson/sass/theme-description.scss | 2 +- newspack-sacha/sass/theme-description.scss | 2 +- newspack-scott/sass/theme-description.scss | 2 +- newspack-theme/sass/theme-description.scss | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 9 files changed, 9 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50c48b495..7542e7abc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,3 @@ -# [2.18.0-hotfix-test-gh-action.2](https://github.com/Automattic/newspack-theme/compare/v2.18.0-hotfix-test-gh-action.1...v2.18.0-hotfix-test-gh-action.2) (2026-01-28) - - -### Bug Fixes - -* enhance release workflow to handle pre-releases ([23c06f3](https://github.com/Automattic/newspack-theme/commit/23c06f3935226118f5880dc9e58c9deab88b7db8)) - # [2.18.0-hotfix-test-gh-action.1](https://github.com/Automattic/newspack-theme/compare/v2.17.0...v2.18.0-hotfix-test-gh-action.1) (2026-01-28) diff --git a/newspack-joseph/sass/theme-description.scss b/newspack-joseph/sass/theme-description.scss index c88b59b0e..6869c73a9 100644 --- a/newspack-joseph/sass/theme-description.scss +++ b/newspack-joseph/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.2 +Version: 2.18.0-hotfix-test-gh-action.1 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-katharine/sass/theme-description.scss b/newspack-katharine/sass/theme-description.scss index caa304c26..265f5e167 100644 --- a/newspack-katharine/sass/theme-description.scss +++ b/newspack-katharine/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.2 +Version: 2.18.0-hotfix-test-gh-action.1 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-nelson/sass/theme-description.scss b/newspack-nelson/sass/theme-description.scss index d485e1aba..224b5d645 100644 --- a/newspack-nelson/sass/theme-description.scss +++ b/newspack-nelson/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.2 +Version: 2.18.0-hotfix-test-gh-action.1 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-sacha/sass/theme-description.scss b/newspack-sacha/sass/theme-description.scss index fa48e5407..0c02cb939 100644 --- a/newspack-sacha/sass/theme-description.scss +++ b/newspack-sacha/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.2 +Version: 2.18.0-hotfix-test-gh-action.1 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-scott/sass/theme-description.scss b/newspack-scott/sass/theme-description.scss index ce9430508..b3d0e11f2 100644 --- a/newspack-scott/sass/theme-description.scss +++ b/newspack-scott/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.2 +Version: 2.18.0-hotfix-test-gh-action.1 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-theme/sass/theme-description.scss b/newspack-theme/sass/theme-description.scss index 776fc85f2..205ce7a16 100644 --- a/newspack-theme/sass/theme-description.scss +++ b/newspack-theme/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.2 +Version: 2.18.0-hotfix-test-gh-action.1 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: newspack-theme diff --git a/package-lock.json b/package-lock.json index a75ea460a..d9da4f681 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "newspack", - "version": "2.18.0-hotfix-test-gh-action.2", + "version": "2.18.0-hotfix-test-gh-action.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "newspack", - "version": "2.18.0-hotfix-test-gh-action.2", + "version": "2.18.0-hotfix-test-gh-action.1", "devDependencies": { "@octokit/rest": "^20.1.2", "chokidar-cli": "^3.0.0", diff --git a/package.json b/package.json index 742628d50..d75200c6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "newspack", - "version": "2.18.0-hotfix-test-gh-action.2", + "version": "2.18.0-hotfix-test-gh-action.1", "description": "A theme for Newspack. https://newspack.com", "bugs": { "url": "https://github.com/Automattic/newspack-theme/issues" From 4353783234afc7e78d79dcb29a94d015fa11962f Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Wed, 28 Jan 2026 11:58:03 -0300 Subject: [PATCH 10/13] Revert "chore(release): 2.18.0-hotfix-test-gh-action.1 [skip ci]" This reverts commit 716b3c50e1f8050dfc11b20e2db6af0d109e2789. --- CHANGELOG.md | 7 ------- newspack-joseph/sass/theme-description.scss | 2 +- newspack-katharine/sass/theme-description.scss | 2 +- newspack-nelson/sass/theme-description.scss | 2 +- newspack-sacha/sass/theme-description.scss | 2 +- newspack-scott/sass/theme-description.scss | 2 +- newspack-theme/sass/theme-description.scss | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 9 files changed, 9 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7542e7abc..c39d91f14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,3 @@ -# [2.18.0-hotfix-test-gh-action.1](https://github.com/Automattic/newspack-theme/compare/v2.17.0...v2.18.0-hotfix-test-gh-action.1) (2026-01-28) - - -### Features - -* test gh release action ([3a37d43](https://github.com/Automattic/newspack-theme/commit/3a37d43cb163eae0f0b85915053494cfca4b0bbd)) - # [2.17.0](https://github.com/Automattic/newspack-theme/compare/v2.16.0...v2.17.0) (2026-01-19) diff --git a/newspack-joseph/sass/theme-description.scss b/newspack-joseph/sass/theme-description.scss index 6869c73a9..0da49f5d0 100644 --- a/newspack-joseph/sass/theme-description.scss +++ b/newspack-joseph/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.1 +Version: 2.17.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-katharine/sass/theme-description.scss b/newspack-katharine/sass/theme-description.scss index 265f5e167..ac34a972b 100644 --- a/newspack-katharine/sass/theme-description.scss +++ b/newspack-katharine/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.1 +Version: 2.17.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-nelson/sass/theme-description.scss b/newspack-nelson/sass/theme-description.scss index 224b5d645..b429dd8a0 100644 --- a/newspack-nelson/sass/theme-description.scss +++ b/newspack-nelson/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.1 +Version: 2.17.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-sacha/sass/theme-description.scss b/newspack-sacha/sass/theme-description.scss index 0c02cb939..085990256 100644 --- a/newspack-sacha/sass/theme-description.scss +++ b/newspack-sacha/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.1 +Version: 2.17.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-scott/sass/theme-description.scss b/newspack-scott/sass/theme-description.scss index b3d0e11f2..89398abe0 100644 --- a/newspack-scott/sass/theme-description.scss +++ b/newspack-scott/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.1 +Version: 2.17.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Template: newspack-theme diff --git a/newspack-theme/sass/theme-description.scss b/newspack-theme/sass/theme-description.scss index 205ce7a16..77a87d3ca 100644 --- a/newspack-theme/sass/theme-description.scss +++ b/newspack-theme/sass/theme-description.scss @@ -6,7 +6,7 @@ Author URI: https://newspack.com Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. Requires at least: 6.7 Tested up to: 6.8 -Version: 2.18.0-hotfix-test-gh-action.1 +Version: 2.17.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: newspack-theme diff --git a/package-lock.json b/package-lock.json index d9da4f681..398004b52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "newspack", - "version": "2.18.0-hotfix-test-gh-action.1", + "version": "2.17.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "newspack", - "version": "2.18.0-hotfix-test-gh-action.1", + "version": "2.17.0", "devDependencies": { "@octokit/rest": "^20.1.2", "chokidar-cli": "^3.0.0", diff --git a/package.json b/package.json index d75200c6b..283fd3b18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "newspack", - "version": "2.18.0-hotfix-test-gh-action.1", + "version": "2.17.0", "description": "A theme for Newspack. https://newspack.com", "bugs": { "url": "https://github.com/Automattic/newspack-theme/issues" From 82ba99a0bf858af3ae75d5cb9cdbf22f0c1123fe Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Wed, 28 Jan 2026 12:25:53 -0300 Subject: [PATCH 11/13] refactor: enhance release synchronization workflow --- .github/workflows/reusable-sync-release.yml | 96 ++++++++++----------- 1 file changed, 44 insertions(+), 52 deletions(-) diff --git a/.github/workflows/reusable-sync-release.yml b/.github/workflows/reusable-sync-release.yml index 948586339..6eee1c886 100644 --- a/.github/workflows/reusable-sync-release.yml +++ b/.github/workflows/reusable-sync-release.yml @@ -12,61 +12,53 @@ jobs: sync-release: runs-on: ubuntu-latest steps: - - name: Get latest release from newspack-theme - id: upstream + - name: Sync releases from newspack-theme env: GH_TOKEN: ${{ github.token }} run: | - # Get latest release (including pre-releases) - LATEST=$(gh release list --repo Automattic/newspack-theme --limit 1 --json tagName,name,isPrerelease -q '.[0]') - TAG=$(echo "$LATEST" | jq -r '.tagName') - NAME=$(echo "$LATEST" | jq -r '.name') - IS_PRERELEASE=$(echo "$LATEST" | jq -r '.isPrerelease') - # Fetch body separately - BODY=$(gh release view "$TAG" --repo Automattic/newspack-theme --json body -q '.body') - echo "tag=$TAG" >> $GITHUB_OUTPUT - echo "name=$NAME" >> $GITHUB_OUTPUT - echo "prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT - # Handle multiline body - { - echo 'body<> $GITHUB_OUTPUT + # Get last 5 releases (including pre-releases) + RELEASES=$(gh release list --repo Automattic/newspack-theme --limit 5 --json tagName,name,isPrerelease) - - name: Check if release already exists - id: check - env: - GH_TOKEN: ${{ github.token }} - run: | - if gh release view "${{ steps.upstream.outputs.tag }}" --repo ${{ github.repository }} > /dev/null 2>&1; then - echo "exists=true" >> $GITHUB_OUTPUT - else - echo "exists=false" >> $GITHUB_OUTPUT - fi + # Process each release (oldest first to maintain chronological order) + echo "$RELEASES" | jq -c 'reverse | .[]' | while read -r RELEASE; do + TAG=$(echo "$RELEASE" | jq -r '.tagName') + NAME=$(echo "$RELEASE" | jq -r '.name') + IS_PRERELEASE=$(echo "$RELEASE" | jq -r '.isPrerelease') - - name: Download theme ZIP from upstream release - if: steps.check.outputs.exists == 'false' - env: - GH_TOKEN: ${{ github.token }} - run: | - gh release download "${{ steps.upstream.outputs.tag }}" \ - --repo Automattic/newspack-theme \ - --pattern "${{ inputs.theme }}.zip" \ - --dir . + echo "Checking release: $TAG" - - name: Create release - if: steps.check.outputs.exists == 'false' - env: - GH_TOKEN: ${{ github.token }} - run: | - PRERELEASE_FLAG="" - if [ "${{ steps.upstream.outputs.prerelease }}" = "true" ]; then - PRERELEASE_FLAG="--prerelease" - fi - gh release create "${{ steps.upstream.outputs.tag }}" \ - --repo ${{ github.repository }} \ - --title "${{ steps.upstream.outputs.name }}" \ - --notes "${{ steps.upstream.outputs.body }}" \ - $PRERELEASE_FLAG \ - "${{ inputs.theme }}.zip" + # Check if release already exists + if gh release view "$TAG" --repo ${{ github.repository }} > /dev/null 2>&1; then + echo "Release $TAG already exists, skipping..." + continue + fi + + echo "Creating release: $TAG" + + # Fetch release body + BODY=$(gh release view "$TAG" --repo Automattic/newspack-theme --json body -q '.body') + + # Download theme ZIP + gh release download "$TAG" \ + --repo Automattic/newspack-theme \ + --pattern "${{ inputs.theme }}.zip" \ + --dir . + + # Create release + PRERELEASE_FLAG="" + if [ "$IS_PRERELEASE" = "true" ]; then + PRERELEASE_FLAG="--prerelease" + fi + + gh release create "$TAG" \ + --repo ${{ github.repository }} \ + --title "$NAME" \ + --notes "$BODY" \ + $PRERELEASE_FLAG \ + "${{ inputs.theme }}.zip" + + # Clean up ZIP for next iteration + rm -f "${{ inputs.theme }}.zip" + + echo "Release $TAG created successfully" + done From 6e39bf530044b07cb42d271cdb588a0518dc6b92 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Fri, 30 Jan 2026 13:55:45 -0300 Subject: [PATCH 12/13] refactor: update reusable workflow reference --- .github/workflows/build-and-test.yml | 4 ++-- .github/workflows/i18n.yml | 2 +- .github/workflows/php.yml | 2 +- .github/workflows/release.yml | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index f1accd79b..10c7a3f6d 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -16,8 +16,8 @@ concurrency: jobs: build: - uses: Automattic/newspack-scripts/.github/workflows/reusable-build.yml@refactor/deprecate-circle-ci + uses: Automattic/newspack-scripts/.github/workflows/reusable-build.yml lint-js-scss: needs: build - uses: Automattic/newspack-scripts/.github/workflows/reusable-lint-js-scss.yml@refactor/deprecate-circle-ci + uses: Automattic/newspack-scripts/.github/workflows/reusable-lint-js-scss.yml diff --git a/.github/workflows/i18n.yml b/.github/workflows/i18n.yml index e2d4788d2..b031c5e29 100644 --- a/.github/workflows/i18n.yml +++ b/.github/workflows/i18n.yml @@ -11,4 +11,4 @@ concurrency: jobs: i18n: - uses: Automattic/newspack-scripts/.github/workflows/reusable-i18n.yml@refactor/deprecate-circle-ci + uses: Automattic/newspack-scripts/.github/workflows/reusable-i18n.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 7e0ec45d2..e504a6d6c 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -16,4 +16,4 @@ concurrency: jobs: lint-php: - uses: Automattic/newspack-scripts/.github/workflows/reusable-lint-php.yml@refactor/deprecate-circle-ci + uses: Automattic/newspack-scripts/.github/workflows/reusable-lint-php.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba074e4ca..0e7743593 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,15 +14,15 @@ concurrency: jobs: build: - uses: Automattic/newspack-scripts/.github/workflows/reusable-build.yml@refactor/deprecate-circle-ci + uses: Automattic/newspack-scripts/.github/workflows/reusable-build.yml release: needs: build - uses: Automattic/newspack-scripts/.github/workflows/reusable-release.yml@refactor/deprecate-circle-ci + uses: Automattic/newspack-scripts/.github/workflows/reusable-release.yml secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} post-release: if: github.ref == 'refs/heads/release' needs: release - uses: Automattic/newspack-scripts/.github/workflows/reusable-post-release.yml@refactor/deprecate-circle-ci + uses: Automattic/newspack-scripts/.github/workflows/reusable-post-release.yml From f1158a5facc566c87a4ca90b25faeea5529a24c8 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Fri, 30 Jan 2026 14:12:05 -0300 Subject: [PATCH 13/13] chore: fix reusable workflow reference --- .github/workflows/i18n.yml | 2 +- .github/workflows/php.yml | 2 +- .github/workflows/release.yml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/i18n.yml b/.github/workflows/i18n.yml index b031c5e29..b1c45ab60 100644 --- a/.github/workflows/i18n.yml +++ b/.github/workflows/i18n.yml @@ -11,4 +11,4 @@ concurrency: jobs: i18n: - uses: Automattic/newspack-scripts/.github/workflows/reusable-i18n.yml + uses: Automattic/newspack-scripts/.github/workflows/reusable-i18n.yml@trunk diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index e504a6d6c..151129ad4 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -16,4 +16,4 @@ concurrency: jobs: lint-php: - uses: Automattic/newspack-scripts/.github/workflows/reusable-lint-php.yml + uses: Automattic/newspack-scripts/.github/workflows/reusable-lint-php.yml@trunk diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e7743593..c3e7f0c39 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,15 +14,15 @@ concurrency: jobs: build: - uses: Automattic/newspack-scripts/.github/workflows/reusable-build.yml + uses: Automattic/newspack-scripts/.github/workflows/reusable-build.yml@trunk release: needs: build - uses: Automattic/newspack-scripts/.github/workflows/reusable-release.yml + uses: Automattic/newspack-scripts/.github/workflows/reusable-release.yml@trunk secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} post-release: if: github.ref == 'refs/heads/release' needs: release - uses: Automattic/newspack-scripts/.github/workflows/reusable-post-release.yml + uses: Automattic/newspack-scripts/.github/workflows/reusable-post-release.yml@trunk