Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 0 additions & 122 deletions .circleci/config.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -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

lint-js-scss:
needs: build
uses: Automattic/newspack-scripts/.github/workflows/reusable-lint-js-scss.yml
64 changes: 64 additions & 0 deletions .github/workflows/build-distributable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build distributable

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-distributable:
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
14 changes: 14 additions & 0 deletions .github/workflows/i18n.yml
Original file line number Diff line number Diff line change
@@ -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@trunk
19 changes: 19 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -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@trunk
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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@trunk

release:
needs: build
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@trunk
64 changes: 64 additions & 0 deletions .github/workflows/reusable-sync-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
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: Sync releases from newspack-theme
env:
GH_TOKEN: ${{ github.token }}
run: |
# Get last 5 releases (including pre-releases)
RELEASES=$(gh release list --repo Automattic/newspack-theme --limit 5 --json tagName,name,isPrerelease)

# 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')

echo "Checking release: $TAG"

# 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
11 changes: 8 additions & 3 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -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: [
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading