diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml deleted file mode 100644 index cdc668c..0000000 --- a/.github/workflows/create-release.yml +++ /dev/null @@ -1,27 +0,0 @@ -on: - push: - # Sequence of patterns matched against refs/tags - tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 - -name: Create Release - -jobs: - build: - name: Create Release - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - body: | - Changes in this Release - draft: false - prerelease: false diff --git a/.github/workflows/npm-beta-publish.yml b/.github/workflows/npm-beta-publish.yml deleted file mode 100644 index 108e578..0000000 --- a/.github/workflows/npm-beta-publish.yml +++ /dev/null @@ -1,29 +0,0 @@ -# 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 - -on: - release: - types: - - prereleased - workflow_dispatch: - -permissions: - contents: read - id-token: write - -jobs: - publish-npm: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version: 22 - registry-url: https://registry.npmjs.org/ - - run: npm install -g npm@latest - - run: npm ci - - run: npm run build - - run: npm publish --tag beta --ignore-scripts - diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index ca27824..43e9280 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -7,22 +7,25 @@ on: release: types: - published - - created - - edited - - released + workflow_dispatch: + +permissions: + contents: read + id-token: write jobs: publish-npm: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 with: - node-version: 18 + node-version: 22 registry-url: https://registry.npmjs.org/ + - run: npm install -g npm@latest - run: npm ci - run: npm run build - - run: npm publish --ignore-scripts - env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} + - run: | + TAG=$(node -p "require('./package.json').version.includes('-') ? 'beta' : 'latest'") + npm publish --provenance --ignore-scripts --tag $TAG