ci: 💚 fix access public for new packages #64
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Checks (Dry-Run) | |
on: | |
pull_request: | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
# Step 1: Check out the repository code | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch the entire history to allow proper versioning | |
# Step 2: Setup pnpm package manager | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
run_install: false | |
# Step 3: Set up Node.js environment | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.OS }}-20.x-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-20.x- | |
# Step 5: Install dependencies | |
- name: Install dependencies | |
run: pnpm i --frozen-lockfile | |
# Step 6: Set SHAs for nx workspace | |
- name: Set SHAs for Nx workspace | |
uses: nrwl/nx-set-shas@v4 | |
# Step 7: Run lint and test for the affected changes | |
- name: Run Nx lint and test | |
run: pnpx nx affected -t lint test --exclude nextjs,vue3 | |
# Step 8: Run the build for the affected changes | |
- name: Run build | |
run: pnpm build | |
# Step 9: Run the release in dry-run mode | |
- name: Run Nx release version (dry-run) | |
run: pnpm exec nx release --skip-publish --dry-run | |
# Step 10: Run publish in dry-run mode | |
- name: Publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NPM_CONFIG_PROVENANCE: true | |
# Use npx instead of yarn because yarn automagically sets NPM_* environment variables | |
# like NPM_CONFIG_REGISTRY so npm publish ends up ignoring the .npmrc file | |
# which is set up by `setup-node` action. | |
run: pnpx nx release publish --access public --verbose --dry-run | |
# Step 11: Upload artifacts | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
path: './dist' | |
# Step 12: Clean up dist directory | |
- name: Cleanup dist directory | |
run: rm -rf ./dist # Remove the dist directory to start fresh |