Skip to content

Commit

Permalink
chore: proper dist folder for npm release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
voznik committed Feb 29, 2024
1 parent 80dbf6b commit 98d1c71
Show file tree
Hide file tree
Showing 7 changed files with 1,934 additions and 1,071 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/nx-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# @see https://nx.dev/recipes/nx-release/publish-in-ci-cd
name: Publish

on:
workflow_dispatch:

jobs:
test:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # needed for provenance data generation
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm install
shell: bash

- name: Print Environment Info
run: npx nx report
shell: bash

- name: Publish packages
run: npx nx release publish
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
NPM_CONFIG_PROVENANCE: true
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
# Publish version to public repository
- name: Publish release version
if: startsWith(github.event.inputs.release-type, 'pre') != true
working-directory: packages/rxdb
working-directory: dist/packages/rxdb
run: |
npm pack
npm publish --access public --non-interactive --no-git-tag-version --tag latest
Expand All @@ -104,7 +104,7 @@ jobs:
# Publish version to public repository
- name: Publish pre-release version
if: startsWith(github.event.inputs.release-type, 'pre')
working-directory: packages/rxdb
working-directory: dist/packages/rxdb
run: |
npm pack
npm publish --access public --non-interactive --no-git-tag-version --tag dev
Expand Down
33 changes: 29 additions & 4 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,28 @@
"affected": {
"defaultBase": "origin/master"
},
"release": {
"projects": [
"packages/*"
],
"projectChangelogs": {
"createRelease": "github"
},
"version": {
"generatorOptions": {
"preid": "dev"
}
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"],
"dependsOn": [
"^build"
],
"inputs": [
"production",
"^production"
],
"cache": true
},
"lint": {
Expand All @@ -24,7 +42,11 @@
"cache": true
},
"@nx/jest:jest": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"inputs": [
"default",
"^production",
"{workspaceRoot}/jest.preset.js"
],
"cache": true,
"options": {
"passWithNoTests": true
Expand All @@ -38,7 +60,10 @@
}
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"default": [
"{projectRoot}/**/*",
"sharedGlobals"
],
"production": [
"default",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
Expand Down
Loading

0 comments on commit 98d1c71

Please sign in to comment.