Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish to npm

on:
workflow_dispatch:

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Install dependencies
run: npm install --legacy-peer-deps --ignore-scripts

- name: Build
run: npm run build

- name: Typecheck
run: npm run typecheck

- name: Verify package is unpublished
run: |
PACKAGE_NAME=$(node -p "require('./package.json').name")
PACKAGE_VERSION=$(node -p "require('./package.json').version")

if npm view "${PACKAGE_NAME}@${PACKAGE_VERSION}" version >/dev/null 2>&1; then
echo "${PACKAGE_NAME}@${PACKAGE_VERSION} is already published"
exit 1
fi

- name: Publish
run: npm publish
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"homepage": "https://github.com/indiespirit/react-native-chart-kit",
"repository": {
"type": "git",
"url": "https://github.com/indiespirit/react-native-chart-kit"
"url": "git+https://github.com/indiespirit/react-native-chart-kit.git"
},
"overrides": {
"@types/react": "16.14.8"
Expand Down
Loading