Skip to content

Changed package manager from yarn to pnpm #86

Changed package manager from yarn to pnpm

Changed package manager from yarn to pnpm #86

name: Theme Translations
on:
pull_request:
paths:
- 'packages/theme-translations/**'
- '.github/workflows/theme-translations.yml'
push:
branches:
- main
paths:
- 'packages/theme-translations/locales/**'
- 'packages/theme-translations/build/**'
- 'packages/theme-translations/test/**'
- '.github/workflows/theme-translations.yml'
permissions:
contents: write
id-token: write
jobs:
test:
name: Test
runs-on: ubuntu-latest
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24
- run: npm test
working-directory: packages/theme-translations
publish:
name: Publish
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
- name: Bump version
working-directory: packages/theme-translations
run: npm version patch --no-git-tag-version
- name: Publish to npm
working-directory: packages/theme-translations
run: |
VERSION=$(node -p "require('./package.json').version")
npm view "@tryghost/theme-translations@${VERSION}" version 2>/dev/null && echo "v${VERSION} already published, skipping" || npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Commit version bump
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
VERSION=$(node -p "require('./packages/theme-translations/package.json').version")
git add packages/theme-translations/package.json
git diff --staged --quiet && echo "Version already committed, skipping" || (git commit -m "chore(theme-translations): bump to v${VERSION}" && git stash --include-untracked && git pull --rebase && git stash pop && git push)