diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ce4ef9419..f2ea0afa5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,6 +29,17 @@ jobs: - run: echo $alpha_version - run: npm --no-git-tag-version version $alpha_version - run: npm publish --tag next + - name: Create Tag + uses: actions/github-script@v7.0.1 + with: + script: | + const {alpha_version} = process.env; + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: `refs/tags/${alpha_version}`, + sha: context.sha + }) docs: name: docs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..60501c000 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Release to NPM +on: + release: + types: [created] + +env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN } + +jobs: + deploy_alpha: + name: Publish npm package + runs-on: [ubuntu-latest] + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 100 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + registry-url: 'https://registry.npmjs.org' + cache: npm + - run: npm ci + - run: npm run build + - run: npm run build:esm + - run: npm publish