diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 8956c31..acb0fd1 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -1,43 +1,23 @@ -# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created -# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages - -name: Node.js Package - +name: Publish package to GitHub Packages on: - push: - # Sequence of patterns matched against refs/heads - branches: - # Push events on main branch - - master - + release: + types: [created] jobs: - build-and-deploy: - runs-on: ubuntu-latest + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - - name: Checkout 🛎️ - uses: actions/checkout@v2 - - - name: Install and Build 🔧 - run: | - npm install - npm run build - - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@4.1.5 + - uses: actions/checkout@v3 + # Setup .npmrc file to publish to GitHub Packages + - uses: actions/setup-node@v3 with: - branch: gh-pages # The branch the action should deploy to. - folder: demo/dist # The folder the action should deploy. - - publish-npm: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - # Setup .npmrc file to publish to npm - - uses: actions/setup-node@v2 - with: - node-version: "12.x" - registry-url: "https://registry.npmjs.org" - - run: npm install + node-version: '16.x' + registry-url: 'https://npm.pkg.github.com' + # Defaults to the user or organization that owns the workflow file + scope: '@win11react' + - run: npm ci - run: npm publish env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.BOT }}