fix(update): resolve npm for updates #919
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: validate | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | |
jobs: | |
lint: | |
name: ⬣ ESLint | |
runs-on: ubuntu-latest | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
- name: β Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: π₯ Download deps | |
uses: bahmutov/npm-install@v1 | |
with: | |
useLockFile: false | |
- name: π¬ Lint | |
run: npm run lint | |
build: | |
name: π Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
- name: β Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: π₯ Download deps | |
uses: bahmutov/npm-install@v1 | |
with: | |
useLockFile: false | |
- name: π Build | |
run: npm run build | |
- name: π¦ Upload All Build Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: all-build-artifacts | |
path: | | |
packages/workshop-app/build | |
packages/workshop-app/dist | |
packages/workshop-presence/dist | |
packages/workshop-utils/dist | |
typecheck: | |
name: Κ¦ TypeScript | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
- name: β Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: π₯ Download deps | |
uses: bahmutov/npm-install@v1 | |
with: | |
useLockFile: false | |
- name: π₯ Download All Build Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: all-build-artifacts | |
path: packages | |
- name: π Type check | |
run: npm run typecheck | |
playwright: | |
name: π Playwright | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
- name: β Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: π₯ Download deps | |
uses: bahmutov/npm-install@v1 | |
with: | |
useLockFile: false | |
- name: π₯ Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: π Playwright tests | |
run: npx playwright test | |
- name: π Upload report | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
example: | |
name: π€ΉββοΈ Example | |
needs: [build] | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
- name: β Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: π₯ Download deps | |
uses: bahmutov/npm-install@v1 | |
with: | |
useLockFile: false | |
- name: π₯ Download All Build Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: all-build-artifacts | |
path: packages | |
- name: βΆοΈ Run setup script | |
run: node setup.mjs | |
working-directory: ./example | |
continue-on-error: true | |
release: | |
name: π Release | |
needs: [lint, typecheck, build, playwright] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NPM_CONFIG_PROVENANCE: 'true' | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: | |
${{ github.repository == 'epicweb-dev/epicshop' && | |
contains('refs/heads/main', github.ref) && github.event_name == 'push' }} | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: β Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: 'https://registry.npmjs.org' | |
- name: π₯ Download deps | |
uses: bahmutov/npm-install@v1 | |
with: | |
useLockFile: false | |
- name: π₯ Download All Build Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: all-build-artifacts | |
path: packages | |
- name: π Release | |
run: npx tsx other/release.ts --dry-run=false |