From b1351c4ccd7adc4c0a57c2a85b213fd021b32218 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Thu, 22 Jan 2026 10:43:35 -0300 Subject: [PATCH 01/15] refactor: move to github actions --- .circleci/config.yml | 30 ----- .github/workflows/release.yml | 42 ++++++ .../reusable-build-distributable.yml | 44 ++++++ .github/workflows/reusable-build.yml | 24 ++++ .../workflows/reusable-check-typescript.yml | 27 ++++ .github/workflows/reusable-generate-docs.yml | 39 ++++++ .github/workflows/reusable-i18n.yml | 127 ++++++++++++++++++ .github/workflows/reusable-lint-js-scss.yml | 28 ++++ .github/workflows/reusable-lint-php.yml | 30 +++++ .github/workflows/reusable-post-release.yml | 35 +++++ .github/workflows/reusable-release.yml | 48 +++++++ .github/workflows/reusable-test-js.yml | 27 ++++ .github/workflows/reusable-test-php.yml | 74 ++++++++++ src/@orb.yml | 8 -- src/commands/checkout_with_workspace.yml | 6 - src/commands/set_node_version.yml | 20 --- src/executors/default.yml | 8 -- src/executors/php-81.yml | 8 -- src/jobs/build-distributable.yml | 25 ---- src/jobs/build.yml | 28 ---- src/jobs/check-typescript.yml | 11 -- src/jobs/generate-docs.yml | 30 ----- src/jobs/i18n.yml | 91 ------------- src/jobs/lint-js-scss.yml | 11 -- src/jobs/lint-php.yml | 12 -- src/jobs/post-release.yml | 10 -- src/jobs/release.yml | 21 --- src/jobs/test-js.yml | 11 -- src/jobs/test-php.yml | 49 ------- 29 files changed, 545 insertions(+), 379 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/reusable-build-distributable.yml create mode 100644 .github/workflows/reusable-build.yml create mode 100644 .github/workflows/reusable-check-typescript.yml create mode 100644 .github/workflows/reusable-generate-docs.yml create mode 100644 .github/workflows/reusable-i18n.yml create mode 100644 .github/workflows/reusable-lint-js-scss.yml create mode 100644 .github/workflows/reusable-lint-php.yml create mode 100644 .github/workflows/reusable-post-release.yml create mode 100644 .github/workflows/reusable-release.yml create mode 100644 .github/workflows/reusable-test-js.yml create mode 100644 .github/workflows/reusable-test-php.yml delete mode 100755 src/@orb.yml delete mode 100755 src/commands/checkout_with_workspace.yml delete mode 100755 src/commands/set_node_version.yml delete mode 100755 src/executors/default.yml delete mode 100755 src/executors/php-81.yml delete mode 100644 src/jobs/build-distributable.yml delete mode 100755 src/jobs/build.yml delete mode 100644 src/jobs/check-typescript.yml delete mode 100644 src/jobs/generate-docs.yml delete mode 100644 src/jobs/i18n.yml delete mode 100644 src/jobs/lint-js-scss.yml delete mode 100644 src/jobs/lint-php.yml delete mode 100644 src/jobs/post-release.yml delete mode 100644 src/jobs/release.yml delete mode 100644 src/jobs/test-js.yml delete mode 100644 src/jobs/test-php.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 18648e3..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: "circleci/node:latest" - steps: - - checkout - - run: - name: Install nvm and use the node version defined in .nvmrc - command: | - # https://support.circleci.com/hc/en-us/articles/360051656632-Swap-node-version-on-CircleCI-convenience-image - set +e - wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash - export NVM_DIR="$HOME/.nvm" - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" - [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" - nvm install - nvm use - # https://stackoverflow.com/a/61823737/3772847 - NODE_DIR=$(dirname $(which node)) - echo "export PATH=$NODE_DIR:\$PATH" >> $BASH_ENV - - run: - name: Check node version (should match the version set in project's .nvmrc file) - command: node --version - - run: - name: install - command: npm install --legacy-peer-deps - - run: - name: release - command: npm run semantic-release || true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..82063d1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Release + +on: + push: + branches: + - trunk + - alpha + - 'hotfix/**' + - 'epic/**' + +jobs: + release: + name: Build and Release + runs-on: ubuntu-latest + permissions: + contents: write + issues: write + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + + - name: Verify Node version + run: node --version + + - name: Install dependencies + run: npm install --legacy-peer-deps + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm run semantic-release diff --git a/.github/workflows/reusable-build-distributable.yml b/.github/workflows/reusable-build-distributable.yml new file mode 100644 index 0000000..06308e3 --- /dev/null +++ b/.github/workflows/reusable-build-distributable.yml @@ -0,0 +1,44 @@ +name: Build Distributable + +on: + workflow_call: + inputs: + archive-name: + description: 'Name of the ZIP archive distributable' + required: true + type: string + +jobs: + build-distributable: + name: Build distributable files + 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: Verify Node version + run: node --version + + - name: Install dependencies + run: npm ci --legacy-peer-deps + + - name: Install rsync + run: sudo apt-get update && sudo apt-get install -y rsync + + - name: Install PHP packages + run: composer install --no-dev --no-scripts + + - name: Build plugin files + run: npm run build && npm run release:archive + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.archive-name }} + path: release/${{ inputs.archive-name }}.zip diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml new file mode 100644 index 0000000..97267a2 --- /dev/null +++ b/.github/workflows/reusable-build.yml @@ -0,0 +1,24 @@ +name: Build + +on: + workflow_call: + +jobs: + build: + name: Install node dependencies + 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: Verify Node version + run: node --version + + - name: Install dependencies + run: npm ci --legacy-peer-deps diff --git a/.github/workflows/reusable-check-typescript.yml b/.github/workflows/reusable-check-typescript.yml new file mode 100644 index 0000000..b754310 --- /dev/null +++ b/.github/workflows/reusable-check-typescript.yml @@ -0,0 +1,27 @@ +name: Check TypeScript + +on: + workflow_call: + +jobs: + check-typescript: + name: Validate TypeScript + 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: Verify Node version + run: node --version + + - name: Install dependencies + run: npm ci --legacy-peer-deps + + - name: Validate TypeScript + run: npm run typescript:check diff --git a/.github/workflows/reusable-generate-docs.yml b/.github/workflows/reusable-generate-docs.yml new file mode 100644 index 0000000..9ceb1b6 --- /dev/null +++ b/.github/workflows/reusable-generate-docs.yml @@ -0,0 +1,39 @@ +name: Generate Docs + +on: + workflow_call: + secrets: + GITHUB_TOKEN: + required: true + +jobs: + generate-docs: + name: Generate documentation + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install -y graphviz plantuml + + - name: Download PHPDocumentor + run: | + curl -L -o ./phpdocumentor https://phpdoc.org/phpDocumentor.phar + chmod +x ./phpdocumentor + + - name: Generate documentation + run: ./phpdocumentor run -d . -t ./docs + + - name: Switch to docs branch, commit, and push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GIT_COMMITTER_NAME: ${{ vars.GIT_COMMITTER_NAME || 'github-actions[bot]' }} + GIT_COMMITTER_EMAIL: ${{ vars.GIT_COMMITTER_EMAIL || 'github-actions[bot]@users.noreply.github.com' }} + run: | + git config user.name "$GIT_COMMITTER_NAME" + git config user.email "$GIT_COMMITTER_EMAIL" + git checkout -b docs + git add -f docs + git commit -m "Update the docs" + git push "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git" docs --force diff --git a/.github/workflows/reusable-i18n.yml b/.github/workflows/reusable-i18n.yml new file mode 100644 index 0000000..d5b5ab6 --- /dev/null +++ b/.github/workflows/reusable-i18n.yml @@ -0,0 +1,127 @@ +name: i18n + +on: + workflow_call: + secrets: + GITHUB_TOKEN: + required: true + +jobs: + i18n: + name: Create translation files + 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: Check if commit author is bot + id: check-bot + env: + GIT_COMMITTER_EMAIL: ${{ vars.GIT_COMMITTER_EMAIL || 'github-actions[bot]@users.noreply.github.com' }} + run: | + COMMIT_AUTHOR=$(git log -1 --pretty=format:'%ae') + if [ "$COMMIT_AUTHOR" = "$GIT_COMMITTER_EMAIL" ]; then + echo "Commit was made by bot ($(git rev-parse --short HEAD)), skipping translation update" + echo "skip=true" >> $GITHUB_OUTPUT + else + echo "skip=false" >> $GITHUB_OUTPUT + fi + + - name: Install dependencies + if: steps.check-bot.outputs.skip != 'true' + run: npm ci --legacy-peer-deps + + - name: Install WP CLI + if: steps.check-bot.outputs.skip != 'true' + 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 + + - name: Build plugin files + if: steps.check-bot.outputs.skip != 'true' + run: npm run build || true + + - name: Create POT translation files + if: steps.check-bot.outputs.skip != 'true' + env: + REPO_NAME: ${{ github.event.repository.name }} + run: | + # Theme is excluded, more in https://github.com/Automattic/newspack-theme/pull/2458 + if [ "$REPO_NAME" = "newspack-theme" ]; then + cd ./newspack-theme + wp i18n make-pot . languages/${REPO_NAME}.pot --exclude='src' --domain=${REPO_NAME} + cd - + else + wp i18n make-pot . languages/${REPO_NAME}.pot --domain=${REPO_NAME} + fi + + - name: Create JSON translation files + if: steps.check-bot.outputs.skip != 'true' + env: + REPO_NAME: ${{ github.event.repository.name }} + run: | + if [ "$REPO_NAME" = "newspack-theme" ]; then + cd ./newspack-theme + fi + + sudo apt-get update && sudo apt-get install -y gettext + + cd languages + + # Create PO files from POT if they don't exist + if [ ! -f "${REPO_NAME}-en_US.po" ]; then + echo "Creating ${REPO_NAME}-en_US.po from POT file" + wp i18n update-po ${REPO_NAME}.pot . + else + echo "${REPO_NAME}-en_US.po file already exists, skipping creation" + fi + + for po in *.po; do + if [ -f "$po" ]; then + echo "Processing file $po …" + # Update translations according to the new POT file + msgmerge $po $REPO_NAME.pot -o $po.out + mv $po.out $po + msgfmt $po -o $(basename $po .po).mo + # no-purge since we need the JS translations for the next run + wp i18n make-json --no-purge $po . + fi + done + + - name: Commit translation files + if: steps.check-bot.outputs.skip != 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO_NAME: ${{ github.event.repository.name }} + GIT_COMMITTER_NAME: ${{ vars.GIT_COMMITTER_NAME || 'github-actions[bot]' }} + GIT_COMMITTER_EMAIL: ${{ vars.GIT_COMMITTER_EMAIL || 'github-actions[bot]@users.noreply.github.com' }} + run: | + if [ "$REPO_NAME" = "newspack-theme" ]; then + cd ./newspack-theme + fi + if [ -d "languages" ]; then + LINES_CHANGED=$(git diff --numstat languages/ | awk '{sum += $1 + $2} END {print sum}') + # If no existing files were changed, check for new files + if [ -z "$LINES_CHANGED" ] || [ "$LINES_CHANGED" -eq 0 ]; then + LINES_CHANGED=$(git ls-files --others --exclude-standard languages/ | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}') + fi + else + LINES_CHANGED=0 + fi + LINES_CHANGED=${LINES_CHANGED:-0} + echo "Lines changed in languages/: $LINES_CHANGED" + if [ "$LINES_CHANGED" -gt 3 ]; then + git config user.email "$GIT_COMMITTER_EMAIL" + git config user.name "$GIT_COMMITTER_NAME" + git remote set-url origin https://x-access-token:$GITHUB_TOKEN@github.com/${{ github.repository }}.git + git add languages/ + git commit -m "chore: update translation files [skip ci]" + git push origin ${{ github.ref_name }} + fi diff --git a/.github/workflows/reusable-lint-js-scss.yml b/.github/workflows/reusable-lint-js-scss.yml new file mode 100644 index 0000000..95f016d --- /dev/null +++ b/.github/workflows/reusable-lint-js-scss.yml @@ -0,0 +1,28 @@ +name: Lint JS & SCSS + +on: + workflow_call: + +jobs: + lint-js-scss: + name: Lint JS & SCSS files + 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: Verify Node version + run: node --version + + - name: Install dependencies + run: npm ci --legacy-peer-deps + + - name: Run Linter + # Temporarily skip linting SCSS due to stylelint config updates. Remove :js when ready to re-enable linting of SCSS. + run: npm run lint:js diff --git a/.github/workflows/reusable-lint-php.yml b/.github/workflows/reusable-lint-php.yml new file mode 100644 index 0000000..60135c2 --- /dev/null +++ b/.github/workflows/reusable-lint-php.yml @@ -0,0 +1,30 @@ +name: Lint PHP + +on: + workflow_call: + inputs: + php-version: + description: 'PHP version to use' + required: false + type: string + default: '8.3' + +jobs: + lint-php: + name: Lint PHP files + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ inputs.php-version }} + tools: composer + + - name: Install Composer dependencies + run: composer install + + - name: Lint PHP files + run: ./vendor/bin/phpcs diff --git a/.github/workflows/reusable-post-release.yml b/.github/workflows/reusable-post-release.yml new file mode 100644 index 0000000..1fbcdab --- /dev/null +++ b/.github/workflows/reusable-post-release.yml @@ -0,0 +1,35 @@ +name: Post Release + +on: + workflow_call: + secrets: + GITHUB_TOKEN: + required: true + SLACK_CHANNEL_ID: + required: false + SLACK_AUTH_TOKEN: + required: false + +jobs: + post-release: + name: Perform post-release tasks + 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: Perform post-release chores + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} + SLACK_AUTH_TOKEN: ${{ secrets.SLACK_AUTH_TOKEN }} + run: ./node_modules/newspack-scripts/post-release.sh diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml new file mode 100644 index 0000000..eb9bacd --- /dev/null +++ b/.github/workflows/reusable-release.yml @@ -0,0 +1,48 @@ +name: Release + +on: + workflow_call: + secrets: + GITHUB_TOKEN: + required: true + NPM_TOKEN: + required: false + +jobs: + release: + name: Release new version + runs-on: ubuntu-latest + permissions: + contents: write + issues: write + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + + - name: Verify Node version + run: node --version + + - name: Install dependencies + run: npm ci --legacy-peer-deps + + - name: Install rsync + run: sudo apt-get update && sudo apt-get install -y rsync + + - name: Install PHP packages + run: composer install --no-dev --no-scripts + + - name: Release new version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm run release diff --git a/.github/workflows/reusable-test-js.yml b/.github/workflows/reusable-test-js.yml new file mode 100644 index 0000000..e5dd261 --- /dev/null +++ b/.github/workflows/reusable-test-js.yml @@ -0,0 +1,27 @@ +name: Test JS + +on: + workflow_call: + +jobs: + test-js: + name: Run JS tests + 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: Verify Node version + run: node --version + + - name: Install dependencies + run: npm ci --legacy-peer-deps + + - name: Run JS Tests + run: npm run test diff --git a/.github/workflows/reusable-test-php.yml b/.github/workflows/reusable-test-php.yml new file mode 100644 index 0000000..b7fa635 --- /dev/null +++ b/.github/workflows/reusable-test-php.yml @@ -0,0 +1,74 @@ +name: Test PHP + +on: + workflow_call: + inputs: + php-version: + description: 'PHP version to use' + required: false + type: string + default: '8.3' + wp-version: + description: 'WordPress version to test against' + required: false + type: string + default: 'latest' + secrets: + CODECOV_TOKEN: + required: false + +jobs: + test-php: + name: Run PHP tests + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: wordpress_test + ports: + - 3306:3306 + options: >- + --health-cmd="mysqladmin ping" + --health-interval=10s + --health-timeout=5s + --health-retries=3 + env: + WP_TESTS_DIR: /tmp/wordpress-tests-lib + WP_CORE_DIR: /tmp/wordpress/ + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ inputs.php-version }} + tools: composer + extensions: mysqli + coverage: pcov + + - name: Install system dependencies + run: sudo apt-get update && sudo apt-get install -y subversion + + - name: Install Composer dependencies + run: composer update + + - name: Setup WordPress test environment + run: | + rm -rf $WP_TESTS_DIR $WP_CORE_DIR + bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 ${{ inputs.wp-version }} + + - name: Run tests with coverage + run: XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover coverage.xml + + - name: Upload coverage to Codecov + if: ${{ env.CODECOV_TOKEN != '' }} + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml + fail_ci_if_error: false + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/src/@orb.yml b/src/@orb.yml deleted file mode 100755 index 5270831..0000000 --- a/src/@orb.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: 2.1 - -description: > - Newspack shared CI config. - -display: - home_url: "https://newspack.com" - source_url: "https://www.github.com/Automattic/newspack-scripts" diff --git a/src/commands/checkout_with_workspace.yml b/src/commands/checkout_with_workspace.yml deleted file mode 100755 index ad3ec5a..0000000 --- a/src/commands/checkout_with_workspace.yml +++ /dev/null @@ -1,6 +0,0 @@ -description: > - Chechout code and attach workspace. -steps: - - checkout - - attach_workspace: - at: ~/ diff --git a/src/commands/set_node_version.yml b/src/commands/set_node_version.yml deleted file mode 100755 index 258ede4..0000000 --- a/src/commands/set_node_version.yml +++ /dev/null @@ -1,20 +0,0 @@ -description: > - Set node version to the one defined in the .nvmrc file. -steps: - - run: - name: Install nvm and use the node version defined in .nvmrc - command: | - # https://support.circleci.com/hc/en-us/articles/360051656632-Swap-node-version-on-CircleCI-convenience-image - set +e - wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash - export NVM_DIR="$HOME/.nvm" - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" - [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" - nvm install - nvm use - # https://stackoverflow.com/a/61823737/3772847 - NODE_DIR=$(dirname $(which node)) - echo "export PATH=$NODE_DIR:\$PATH" >> $BASH_ENV - - run: - name: Check node version (should match the version set in project's .nvmrc file) - command: node --version diff --git a/src/executors/default.yml b/src/executors/default.yml deleted file mode 100755 index b9c2e06..0000000 --- a/src/executors/default.yml +++ /dev/null @@ -1,8 +0,0 @@ -description: PHP executor -docker: - - image: "cimg/php:<>" -parameters: - tag: - default: 8.3-node - description: PHP image version - type: string diff --git a/src/executors/php-81.yml b/src/executors/php-81.yml deleted file mode 100755 index c7e0dfc..0000000 --- a/src/executors/php-81.yml +++ /dev/null @@ -1,8 +0,0 @@ -description: PHP executor -docker: - - image: "cimg/php:<>" -parameters: - tag: - default: 8.1-node - description: PHP image version - type: string diff --git a/src/jobs/build-distributable.yml b/src/jobs/build-distributable.yml deleted file mode 100644 index 79ceb98..0000000 --- a/src/jobs/build-distributable.yml +++ /dev/null @@ -1,25 +0,0 @@ -description: > - Build the distributable files, so they are available as CI artifacts. - -executor: default - -parameters: - archive-name: - type: string - default: "" - description: "Name of the ZIP archive distributable." - -steps: - - checkout_with_workspace - - set_node_version - - run: - name: Install rsync - command: sudo apt-get update && sudo apt-get install rsync - - run: - name: Install PHP packages - command: composer install --no-dev --no-scripts - - run: - name: Build plugin files - command: npm run build && npm run release:archive - - store_artifacts: - path: release/<>.zip diff --git a/src/jobs/build.yml b/src/jobs/build.yml deleted file mode 100755 index dce2c58..0000000 --- a/src/jobs/build.yml +++ /dev/null @@ -1,28 +0,0 @@ -description: > - Install node dependencies. - -executor: default - -steps: - - checkout_with_workspace - - set_node_version - - restore_cache: - key: v1-npm-{{ checksum "package.json" }}-{{checksum "package-lock.json" }}-{{ checksum ".nvmrc" }} - # https://medium.com/@mdsky1986/caching-node-dependencies-when-using-npm-ci-89fe3f46404a - - run: - name: Install node dependencies - # --legacy-peer-deps flag should be removed once https://github.com/Automattic/newspack-plugin/issues/1218 is resolved - command: | - if test -d "node_modules"; then - echo "package.json and package-lock.json unchanged. Using cache." - else - npm ci --legacy-peer-deps --loglevel warn --yes - fi - - save_cache: - key: v1-npm-{{ checksum "package.json" }}-{{checksum "package-lock.json" }}-{{ checksum ".nvmrc" }} - paths: - - node_modules - - persist_to_workspace: - root: ~/ - paths: - - project diff --git a/src/jobs/check-typescript.yml b/src/jobs/check-typescript.yml deleted file mode 100644 index 3af092a..0000000 --- a/src/jobs/check-typescript.yml +++ /dev/null @@ -1,11 +0,0 @@ -description: > - Validate TypeScript. - -executor: default - -steps: - - checkout_with_workspace - - set_node_version - - run: - name: Validate TypeScript - command: npm run typescript:check diff --git a/src/jobs/generate-docs.yml b/src/jobs/generate-docs.yml deleted file mode 100644 index 6a878d8..0000000 --- a/src/jobs/generate-docs.yml +++ /dev/null @@ -1,30 +0,0 @@ -description: > - Generate documentation. This will create a new branch called docs and push the HTML documentation to it, as /docs directory. - To make this work with GH pages, visit /settings/pages, set branch to "docs", and folder to "/docs". - -executor: php-81 - -steps: - - checkout - - run: - name: Install dependencies - command: | - sudo apt-get update && sudo apt-get install -y graphviz plantuml - - run: - name: Download PHPDocumentor - command: | - curl -L -o ./phpdocumentor https://phpdoc.org/phpDocumentor.phar - chmod +x ./phpdocumentor - - run: - name: Generate documentation - command: | - ./phpdocumentor run -d . -t ./docs - - run: - name: Switch to docs branch, commit, and push - command: | - git config user.name "${GIT_COMMITTER_NAME}" - git config user.email "${GITHUB_COMMITER_EMAIL}" - git checkout -b docs - git add -f docs - git commit -m "Update the docs" - git push "https://${GITHUB_TOKEN}@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git" --force diff --git a/src/jobs/i18n.yml b/src/jobs/i18n.yml deleted file mode 100644 index 684bff7..0000000 --- a/src/jobs/i18n.yml +++ /dev/null @@ -1,91 +0,0 @@ -description: > - Create translation files. - -executor: default - -steps: - - checkout_with_workspace - - run: - name: Check if commit author is bot - command: | - COMMIT_AUTHOR=$(git log -1 --pretty=format:'%ae') - if [ "$COMMIT_AUTHOR" = "$GITHUB_COMMITER_EMAIL" ]; then - echo "Commit was made by bot ($(git rev-parse --short HEAD)), skipping translation update" - circleci step halt - fi - - run: - name: Install WP CLI - command: | - 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 - - run: - name: Build plugin files, so dist dir is available - command: | - npm run build || true - - run: - name: Create POT translation files - command: | - # Theme is excluded, more in https://github.com/Automattic/newspack-theme/pull/2458 - if [ "$CIRCLE_PROJECT_REPONAME" = "newspack-theme" ]; then - cd ./newspack-theme - wp i18n make-pot . languages/${CIRCLE_PROJECT_REPONAME}.pot --exclude='src' --domain=${CIRCLE_PROJECT_REPONAME} - cd - - else - wp i18n make-pot . languages/${CIRCLE_PROJECT_REPONAME}.pot --domain=${CIRCLE_PROJECT_REPONAME} - fi - - run: - name: Create JSON translation files - command: | - if [ "$CIRCLE_PROJECT_REPONAME" = "newspack-theme" ]; then - cd ./newspack-theme - fi - - sudo apt-get update && sudo apt-get install -y gettext - - cd languages - - # Create PO files from POT if they don't exist - if [ ! -f "${CIRCLE_PROJECT_REPONAME}-en_US.po" ]; then - echo "Creating ${CIRCLE_PROJECT_REPONAME}-en_US.po from POT file" - wp i18n update-po ${CIRCLE_PROJECT_REPONAME}.pot . - else - echo "${CIRCLE_PROJECT_REPONAME}-en_US.po file already exists, skipping creation" - fi - - for po in *.po; do - if [ -f "$po" ]; then - echo "Processing file $po …" - # Update translations according to the new POT file - msgmerge $po $CIRCLE_PROJECT_REPONAME.pot -o $po.out - mv $po.out $po - msgfmt $po -o $(basename $po .po).mo - # no-purge since we need the JS translations for the next run - wp i18n make-json --no-purge $po . - fi - done - - run: - name: Commit translation files - command: | - if [ "$CIRCLE_PROJECT_REPONAME" = "newspack-theme" ]; then - cd ./newspack-theme - fi - if [ -d "languages" ]; then - LINES_CHANGED=$(git diff --numstat languages/ | awk '{sum += $1 + $2} END {print sum}') - # If no existing files were changed, check for new files - if [ -z "$LINES_CHANGED" ] || [ "$LINES_CHANGED" -eq 0 ]; then - LINES_CHANGED=$(git ls-files --others --exclude-standard languages/ | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}') - fi - else - LINES_CHANGED=0 - fi - LINES_CHANGED=${LINES_CHANGED:-0} - echo "Lines changed in languages/: $LINES_CHANGED" - if [ "$LINES_CHANGED" -gt 3 ]; then - git config user.email "$GITHUB_COMMITER_EMAIL" - git config user.name "$GIT_COMMITTER_NAME" - git remote set-url origin https://$GITHUB_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git - git add languages/ - git commit -m "chore: update translation files [skip ci]" - git push origin $CIRCLE_BRANCH - fi diff --git a/src/jobs/lint-js-scss.yml b/src/jobs/lint-js-scss.yml deleted file mode 100644 index 86873d2..0000000 --- a/src/jobs/lint-js-scss.yml +++ /dev/null @@ -1,11 +0,0 @@ -description: > - Lint the JS & SCSS (temporarily skipped) files. - -executor: default - -steps: - - checkout_with_workspace - - set_node_version - - run: - name: Run Linter - command: npm run lint:js # Temporarily skip linting SCSS due to stylelint config updates. Remove :js when ready to re-enable linting of SCSS. diff --git a/src/jobs/lint-php.yml b/src/jobs/lint-php.yml deleted file mode 100644 index eae5746..0000000 --- a/src/jobs/lint-php.yml +++ /dev/null @@ -1,12 +0,0 @@ -description: > - Lint PHP files. - -executor: default - -steps: - - checkout - - run: - name: Lint Files - command: | - composer install - ./vendor/bin/phpcs diff --git a/src/jobs/post-release.yml b/src/jobs/post-release.yml deleted file mode 100644 index 418d190..0000000 --- a/src/jobs/post-release.yml +++ /dev/null @@ -1,10 +0,0 @@ -description: > - Perform post-release tasks. - -executor: default - -steps: - - checkout_with_workspace - - run: - name: Perform post-release chores - command: ./node_modules/newspack-scripts/post-release.sh diff --git a/src/jobs/release.yml b/src/jobs/release.yml deleted file mode 100644 index 09f977f..0000000 --- a/src/jobs/release.yml +++ /dev/null @@ -1,21 +0,0 @@ -description: > - Release new version. - -executor: default - -steps: - - checkout_with_workspace - - set_node_version - - run: - name: Install rsync - command: sudo apt-get update && sudo apt-get install rsync - - run: - name: Install PHP packages - command: composer install --no-dev --no-scripts - - run: - name: Release new version - command: npm run release - - persist_to_workspace: - root: ~/ - paths: - - project diff --git a/src/jobs/test-js.yml b/src/jobs/test-js.yml deleted file mode 100644 index 5c5ddae..0000000 --- a/src/jobs/test-js.yml +++ /dev/null @@ -1,11 +0,0 @@ -description: > - Run JS tests. - -executor: default - -steps: - - checkout_with_workspace - - set_node_version - - run: - name: Run JS Tests - command: npm run test diff --git a/src/jobs/test-php.yml b/src/jobs/test-php.yml deleted file mode 100644 index c27feff..0000000 --- a/src/jobs/test-php.yml +++ /dev/null @@ -1,49 +0,0 @@ -description: > - Run PHP tests. - -docker: - - image: cimg/php:8.3 - - image: circleci/mysql:5.6.50 - -environment: - - WP_TESTS_DIR: "/tmp/wordpress-tests-lib" - - WP_CORE_DIR: "/tmp/wordpress/" -steps: - - checkout - - run: - name: Setup Environment Variables - command: | - echo "export PATH=$HOME/.composer/vendor/bin:$PATH" >> $BASH_ENV - source /home/circleci/.bashrc - - run: - name: Install Dependencies - command: | - sudo apt-get update && sudo apt-get install -y subversion default-mysql-client - - run: - name: Run Tests with Coverage - command: | - composer update - rm -rf $WP_TESTS_DIR $WP_CORE_DIR - bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest - # https://circleci.com/docs/code-coverage/#php - XDEBUG_MODE=coverage phpdbg -qrr vendor/bin/phpunit --coverage-clover coverage.xml - - run: - name: Upload Test Results to Codecov - command: | - if [[ -n $CODECOV_TOKEN ]]; then - # download Codecov CLI - curl -Os https://cli.codecov.io/latest/linux/codecov - - # integrity check - curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step - curl -Os https://cli.codecov.io/latest/linux/codecov - curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM - curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig - gpgv codecov.SHA256SUM.sig codecov.SHA256SUM - - shasum -a 256 -c codecov.SHA256SUM - sudo chmod +x codecov - ./codecov upload-process -t $CODECOV_TOKEN - else - echo "CODECOV_TOKEN is not set. Skipping upload to Codecov." - fi From 558b5a1e72824036cb573ac8f33e12ec0bc28f7e Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Thu, 22 Jan 2026 14:47:28 -0300 Subject: [PATCH 02/15] fix: let the script create the db --- .github/workflows/reusable-test-php.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/reusable-test-php.yml b/.github/workflows/reusable-test-php.yml index b7fa635..d13be96 100644 --- a/.github/workflows/reusable-test-php.yml +++ b/.github/workflows/reusable-test-php.yml @@ -26,7 +26,6 @@ jobs: image: mysql:5.7 env: MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: wordpress_test ports: - 3306:3306 options: >- From 656cf67d674b5bf2fa377292abb3aeca928a6474 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Thu, 22 Jan 2026 16:25:56 -0300 Subject: [PATCH 03/15] fix: release workflow --- .github/workflows/reusable-release.yml | 2 -- scripts/release.js | 9 ++++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index eb9bacd..f35f8b6 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -3,8 +3,6 @@ name: Release on: workflow_call: secrets: - GITHUB_TOKEN: - required: true NPM_TOKEN: required: false diff --git a/scripts/release.js b/scripts/release.js index 40c3974..7c14d36 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -10,15 +10,18 @@ const { files, ...otherArgs } = require( 'yargs/yargs' )( const filesList = files.split( ',' ); -utils.log( `Releasing ${ process.env.CIRCLE_PROJECT_REPONAME }…` ); +// Get repository name from GitHub Actions environment variable (format: owner/repo). +const repoName = process.env.GITHUB_REPOSITORY?.split( '/' )[ 1 ] || 'unknown'; + +utils.log( `Releasing ${ repoName }…` ); const getConfig = ({ gitBranchName }) => { const branchType = gitBranchName.split("/")[0]; const githubConfig = { assets: [ { - path: `./release/${process.env.CIRCLE_PROJECT_REPONAME}.zip`, - label: `${process.env.CIRCLE_PROJECT_REPONAME}.zip`, + path: `./release/${ repoName }.zip`, + label: `${ repoName }.zip`, }, ], }; From ed7a28c76c672d02b9ee87314be26674c47b729c Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Thu, 22 Jan 2026 16:30:11 -0300 Subject: [PATCH 04/15] fix: post-release workflow --- .github/workflows/reusable-post-release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/reusable-post-release.yml b/.github/workflows/reusable-post-release.yml index 1fbcdab..611f491 100644 --- a/.github/workflows/reusable-post-release.yml +++ b/.github/workflows/reusable-post-release.yml @@ -3,8 +3,6 @@ name: Post Release on: workflow_call: secrets: - GITHUB_TOKEN: - required: true SLACK_CHANNEL_ID: required: false SLACK_AUTH_TOKEN: From 991821bcb7062dc6aab02a1f2f2b01f0f141db04 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Thu, 22 Jan 2026 16:35:12 -0300 Subject: [PATCH 05/15] fix: i18n workflow --- .github/workflows/reusable-i18n.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/reusable-i18n.yml b/.github/workflows/reusable-i18n.yml index d5b5ab6..2ae2bd9 100644 --- a/.github/workflows/reusable-i18n.yml +++ b/.github/workflows/reusable-i18n.yml @@ -2,9 +2,6 @@ name: i18n on: workflow_call: - secrets: - GITHUB_TOKEN: - required: true jobs: i18n: From 41b03ee7bf40fff14ad13603839dd3e92698fb40 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Fri, 23 Jan 2026 10:34:43 -0300 Subject: [PATCH 06/15] fix: i18n exclude src dir --- .github/workflows/reusable-i18n.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-i18n.yml b/.github/workflows/reusable-i18n.yml index 2ae2bd9..9d8bef4 100644 --- a/.github/workflows/reusable-i18n.yml +++ b/.github/workflows/reusable-i18n.yml @@ -56,7 +56,7 @@ jobs: wp i18n make-pot . languages/${REPO_NAME}.pot --exclude='src' --domain=${REPO_NAME} cd - else - wp i18n make-pot . languages/${REPO_NAME}.pot --domain=${REPO_NAME} + wp i18n make-pot . languages/${REPO_NAME}.pot --exclude='src' --domain=${REPO_NAME} fi - name: Create JSON translation files From 025ea169e53a1f5f6889667229acfdee9f8e8605 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Fri, 23 Jan 2026 10:42:25 -0300 Subject: [PATCH 07/15] fix(i18n): increase php nesting level --- .github/workflows/reusable-i18n.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/reusable-i18n.yml b/.github/workflows/reusable-i18n.yml index 9d8bef4..721fb04 100644 --- a/.github/workflows/reusable-i18n.yml +++ b/.github/workflows/reusable-i18n.yml @@ -45,6 +45,9 @@ jobs: if: steps.check-bot.outputs.skip != 'true' run: npm run build || true + - name: Set higher Xdebug stack limit + run: echo "xdebug.max_nesting_level=1000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini + - name: Create POT translation files if: steps.check-bot.outputs.skip != 'true' env: From 3a37606d206bc3eab823cd0c815ff6b785c404f1 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Fri, 23 Jan 2026 10:46:51 -0300 Subject: [PATCH 08/15] fix: create xdebug dir --- .github/workflows/reusable-i18n.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-i18n.yml b/.github/workflows/reusable-i18n.yml index 721fb04..94ad715 100644 --- a/.github/workflows/reusable-i18n.yml +++ b/.github/workflows/reusable-i18n.yml @@ -45,7 +45,10 @@ jobs: if: steps.check-bot.outputs.skip != 'true' run: npm run build || true - - name: Set higher Xdebug stack limit + - name: Create xdebug configuration directory + run: mkdir -p /usr/local/etc/php/conf.d + + - name: Configure xdebug run: echo "xdebug.max_nesting_level=1000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini - name: Create POT translation files From 172cc5df78d8102e6b5a2231f4c76a0506d6f385 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Fri, 23 Jan 2026 10:54:15 -0300 Subject: [PATCH 09/15] fix: remove custom config --- .github/workflows/reusable-i18n.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/reusable-i18n.yml b/.github/workflows/reusable-i18n.yml index 94ad715..9d8bef4 100644 --- a/.github/workflows/reusable-i18n.yml +++ b/.github/workflows/reusable-i18n.yml @@ -45,12 +45,6 @@ jobs: if: steps.check-bot.outputs.skip != 'true' run: npm run build || true - - name: Create xdebug configuration directory - run: mkdir -p /usr/local/etc/php/conf.d - - - name: Configure xdebug - run: echo "xdebug.max_nesting_level=1000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini - - name: Create POT translation files if: steps.check-bot.outputs.skip != 'true' env: From 98493219acecca7bd953835438adc7694119a9b8 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Fri, 23 Jan 2026 10:56:58 -0300 Subject: [PATCH 10/15] fix: alternate custom config strategy --- .github/workflows/reusable-i18n.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/reusable-i18n.yml b/.github/workflows/reusable-i18n.yml index 9d8bef4..bc92842 100644 --- a/.github/workflows/reusable-i18n.yml +++ b/.github/workflows/reusable-i18n.yml @@ -34,6 +34,12 @@ jobs: if: steps.check-bot.outputs.skip != 'true' run: npm ci --legacy-peer-deps + - name: Configure PHP for deep nesting + if: steps.check-bot.outputs.skip != 'true' + run: | + # Increase xdebug max_nesting_level to handle deeply nested JS files + echo "xdebug.max_nesting_level=512" | sudo tee -a $(php -i | grep "Scan this dir for additional .ini files" | cut -d' ' -f9)/99-custom.ini + - name: Install WP CLI if: steps.check-bot.outputs.skip != 'true' run: | From 74d2c85795e10b77450ce551cc98b472eb9daaa0 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Fri, 23 Jan 2026 11:18:51 -0300 Subject: [PATCH 11/15] fix: label char limit --- scripts/release.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/release.js b/scripts/release.js index 7c14d36..4dede87 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -24,6 +24,10 @@ const getConfig = ({ gitBranchName }) => { label: `${ repoName }.zip`, }, ], + // Custom label template that caps at 50 chars (GitHub's limit). + releasedLabels: [ + '<%= ("released" + (nextRelease.channel ? " on @" + nextRelease.channel : "")).substring(0, 50) %>', + ], }; // Only post GH PR comments for alpha, hotfix/*, and release branches. From 37a87cce7b14af4b6b15dfd93b442dfd22afc0b6 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Fri, 23 Jan 2026 12:21:53 -0300 Subject: [PATCH 12/15] fix: release command --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 82063d1..ea1c408 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,4 +39,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm run semantic-release + run: npm run release From bfa681bf617d7bb7b29a01f605ed940fedf2f3fb Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Fri, 23 Jan 2026 12:41:53 -0300 Subject: [PATCH 13/15] fix: post release vars and release asset --- .github/workflows/release.yml | 2 +- post-release.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea1c408..3091d82 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,4 +39,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm run release + run: npm run release:archive && npm run semantic-release diff --git a/post-release.sh b/post-release.sh index 7bac57a..b8a1c19 100755 --- a/post-release.sh +++ b/post-release.sh @@ -23,13 +23,13 @@ if [[ $(echo $SECOND_TO_LAST_COMMIT_MSG | grep '^Merge .*alpha') ]]; then # we don't care about any alpha changes. git reset --hard release -- # Force-push the alpha branch. - git push "https://$GITHUB_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git" --force + git push "https://$GITHUB_TOKEN@github.com/${GITHUB_REPOSITORY}.git" --force else echo '[newspack-scripts] Release was created from a different branch than the alpha branch (e.g. a hotfix branch).' echo '[newspack-scripts] Alpha branch will now be updated with the lastest changes from release.' git merge --no-ff release -m "chore(release): merge in release $LATEST_VERSION_TAG" if [[ $? == 0 ]]; then - git push "https://$GITHUB_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git" + git push "https://$GITHUB_TOKEN@github.com/${GITHUB_REPOSITORY}.git" else git merge --abort echo '[newspack-scripts] Post-release merge to alpha failed.' @@ -55,7 +55,7 @@ git checkout trunk git merge --no-ff release -m "chore(release): merge in release $LATEST_VERSION_TAG" if [[ $? == 0 ]]; then echo '[newspack-scripts] Pushing updated trunk to origin.' - git push "https://$GITHUB_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git" + git push "https://$GITHUB_TOKEN@github.com/${GITHUB_REPOSITORY}.git" else git merge --abort echo '[newspack-scripts] Post-release merge to trunk failed.' From 704b6ee85801396d057ac18e4d8ad7c06dc3b21d Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Fri, 23 Jan 2026 16:09:28 -0300 Subject: [PATCH 14/15] fix: release command --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3091d82..82063d1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,4 +39,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm run release:archive && npm run semantic-release + run: npm run semantic-release From 42fa51aaa5fd7009ea70ef01a724964bb1958fcc Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Fri, 23 Jan 2026 16:30:18 -0300 Subject: [PATCH 15/15] chore: temporarily disable pr comments (prevent spam) --- scripts/release.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/release.js b/scripts/release.js index 4dede87..2f26744 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -31,10 +31,11 @@ const getConfig = ({ gitBranchName }) => { }; // Only post GH PR comments for alpha, hotfix/*, and release branches. - if ( ! ["alpha", "hotfix", "release"].includes(branchType) ) { - githubConfig.successComment = false; - githubConfig.failComment = false; - } + // if ( ! ["alpha", "hotfix", "release"].includes(branchType) ) { + // Temporarily disable comments for all branches to prevent spam. + githubConfig.successComment = false; + githubConfig.failComment = false; + // } // Only publish alpha and release branches to NPM. const shouldPublishOnNPM = Boolean( process.env.NPM_TOKEN ) && ["alpha", "release"].includes(branchType);