Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix publishing NPM packages via GitHub Actions

Damian Legawiec5670662eb448
diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml
index d22605e805..96e34fd05e 100644
--- a/.github/workflows/packages.yml
+++ b/.github/workflows/packages.yml
@@ -4,16 +4,16 @@ on:
push:
branches: [main]
paths:
- - 'packages/**'
- - 'pnpm-lock.yaml'
- - 'turbo.json'
- - '.github/workflows/packages.yml'
+ - "packages/**"
+ - "pnpm-lock.yaml"
+ - "turbo.json"
+ - ".github/workflows/packages.yml"
pull_request:
paths:
- - 'packages/**'
- - 'pnpm-lock.yaml'
- - 'turbo.json'
- - '.github/workflows/packages.yml'
+ - "packages/**"
+ - "pnpm-lock.yaml"
+ - "turbo.json"
+ - ".github/workflows/packages.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -61,10 +61,15 @@ jobs:
with:
node-version: 20
cache: pnpm
+ registry-url: https://registry.npmjs.org
- run: pnpm install --frozen-lockfile
working-directory: .
+ - name: Upgrade npm for Trusted Publishing support
+ run: npm install -g npm@latest
+ working-directory: .
+
- name: Check if version is published
id: check
run: |
@@ -77,7 +82,7 @@ jobs:
- name: Build and Publish
if: steps.check.outputs.published == 'false'
- run: pnpm build && pnpm publish --provenance --access public --no-git-checks
+ run: pnpm build && npm publish --provenance --access public
release-next:
name: "Next - Release"
@@ -100,10 +105,15 @@ jobs:
with:
node-version: 20
cache: pnpm
+ registry-url: https://registry.npmjs.org
- run: pnpm install --frozen-lockfile
working-directory: .
+ - name: Upgrade npm for Trusted Publishing support
+ run: npm install -g npm@latest
+ working-directory: .
+
- name: Check if version is published
id: check
run: |
@@ -116,4 +126,4 @@ jobs:
- name: Build and Publish
if: steps.check.outputs.published == 'false'
- run: pnpm build && pnpm publish --provenance --access public --no-git-checks
+ run: pnpm turbo build --filter=@spree/next && npm publish --provenance --access public