Skip to content

chore: migrate to pnpm and enable minimum release age #5304

chore: migrate to pnpm and enable minimum release age

chore: migrate to pnpm and enable minimum release age #5304

name: Check & Release
on:
push:
branches: [ master, renovate/** ]
pull_request:
branches: [ master ]
jobs:
test:
name: Test
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [ 20, 22, 24 ]
steps:
- uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm and dependencies
uses: apify/workflows/pnpm-install@main
- name: Run Tests
run: pnpm test
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install pnpm and dependencies
uses: apify/workflows/pnpm-install@main
- run: pnpm build
- name: Check build consistency
run: |
git diff --exit-code || {
echo -e "Some files changed after running pnpm build! Please build the project locally and commit the changes.";
exit 1;
}
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install pnpm and dependencies
uses: apify/workflows/pnpm-install@main
- run: pnpm lint
publish:
name: Publish to NPM
if: github.ref == 'refs/heads/master'
needs: [ test, build, lint ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # we need to pull everything to allow lerna to detect what packages changed
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Install pnpm and dependencies
uses: apify/workflows/pnpm-install@main
- name: Check for changes
id: changed_packages
run: |
echo "changed_packages=$(pnpm exec lerna changed -p | wc -l | xargs)" | tee -a $GITHUB_OUTPUT
- name: Execute publish workflow
if: steps.changed_packages.outputs.changed_packages != '0'
uses: apify/workflows/execute-workflow@main
with:
workflow: publish_to_npm.yaml
inputs: >
{
"ref": "master"
}