Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish package to multiple registries #3

Merged
merged 10 commits into from
Jan 26, 2024
32 changes: 28 additions & 4 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ permissions:

jobs:
build:
# allow failure publishing to npm for now
# TODO: remove this once we have a token
continue-on-error: ${{ matrix.registry.url == 'https://registry.npmjs.org' }}
strategy:
matrix:
registry:
- url: https://registry.npmjs.org
token_secret: NPM_TOKEN
- url: https://npm.pkg.github.com
token_secret: GITHUB_TOKEN
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -24,16 +34,30 @@ jobs:
run_install: false

- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: pnpm
registry-url: ${{ matrix.registry.url }}
scope: "@invoke-ai"

- name: Install dependencies
run: pnpm install --frozen-lockfile
run: pnpm install --frozen-lockfile --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets[matrix.registry.token_secret] }}

- name: Version bump
# only if manual workflow dispatch and not on a tag
if: github.event_name == 'workflow_dispatch' && !startsWith(github.ref, 'refs/tags/')
run: npm version prepatch --preid=$(git rev-parse --short HEAD) --no-git-tag-version

- name: Publish
shell: bash
run: pnpm publish --access public --no-git-checks
run: |
# manual workflow dispatches are tagged as pre-release - all releases should go through proper tagging process
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
FLAGS="--tag pre"
fi
pnpm publish --access public --no-git-checks $FLAGS
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets[matrix.registry.token_secret] }}
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
@invoke-ai:registry=https://npm.pkg.github.com
auto-install-peers=true
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@invoke-ai/ui",
"version": "0.0.16",
"name": "@invoke-ai/ui-library",
"version": "0.0.17",
"description": "UI Components for Invoke's applications.",
"directories": {
"lib": "lib"
},
"repository": {
"type": "git",
"url": "git+https://github.com/invoke-ai/ui.git"
"url": "git+https://github.com/invoke-ai/ui-library.git"
},
"publishConfig": {
"access": "public",
Expand All @@ -16,9 +16,9 @@
"author": "Invoke",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/invoke-ai/ui/issues"
"url": "https://github.com/invoke-ai/ui-library/issues"
},
"homepage": "https://github.com/invoke-ai/ui#readme",
"homepage": "https://github.com/invoke-ai/ui-library#readme",
"type": "module",
"main": "dist/main.js",
"types": "dist/main.d.ts",
Expand Down Expand Up @@ -50,9 +50,9 @@
"framer-motion": "^10.18.0",
"lodash-es": "^4.17.21",
"nanostores": "^0.9.5",
"overlayscrollbars": "^2.4.6",
"overlayscrollbars-react": "^0.5.3",
"react-i18next": "^14.0.0",
"overlayscrollbars": "^2.4.7",
"overlayscrollbars-react": "^0.5.4",
"react-i18next": "^14.0.1",
"react-icons": "^5.0.1",
"react-select": "^5.8.0"
},
Expand All @@ -62,27 +62,27 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@invoke-ai/eslint-config-react": "^0.0.4",
"@invoke-ai/eslint-config-react": "^0.0.8",
"@invoke-ai/prettier-config-react": "^0.0.3",
"@storybook/addon-essentials": "^7.6.9",
"@storybook/addon-interactions": "^7.6.9",
"@storybook/addon-links": "^7.6.9",
"@storybook/addon-onboarding": "^1.0.10",
"@storybook/blocks": "^7.6.9",
"@storybook/react": "^7.6.9",
"@storybook/react-vite": "^7.6.9",
"@storybook/test": "^7.6.9",
"@storybook/addon-essentials": "^7.6.10",
"@storybook/addon-interactions": "^7.6.10",
"@storybook/addon-links": "^7.6.10",
"@storybook/addon-onboarding": "^1.0.11",
"@storybook/blocks": "^7.6.10",
"@storybook/react": "^7.6.10",
"@storybook/react-vite": "^7.6.10",
"@storybook/test": "^7.6.10",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.11.5",
"@types/node": "^20.11.7",
"@types/react": "^18.2.48",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.56.0",
"prettier": "^3.2.4",
"storybook": "^7.6.9",
"storybook": "^7.6.10",
"typescript": "^5.3.3",
"vite": "^5.0.11",
"vite-plugin-dts": "^3.7.1"
"vite": "^5.0.12",
"vite-plugin-dts": "^3.7.2"
},
"lint-staged": {
"*.{ts,tsx}": [
Expand Down
Loading
Loading