mirror of
https://github.com/better-auth/better-auth.git
synced 2026-06-02 12:26:43 -05:00
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
release:
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- run: npx changelogithub
|
|
env:
|
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20.x
|
|
registry-url: 'https://registry.npmjs.org'
|
|
cahce: pnpm
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 8
|
|
|
|
- run: pnpm install
|
|
|
|
- name: Build
|
|
run: pnpm build
|
|
|
|
- name: Check version
|
|
id: check_version
|
|
run: |
|
|
version=$(node -p "require('./package.json').version")
|
|
if [[ $version == *"beta"* ]]; then
|
|
echo "::set-output name=tag::beta"
|
|
elif [[ $version == *"alpha"* ]]; then
|
|
echo "::set-output name=tag::alpha"
|
|
else
|
|
|
|
- name: Publish to npm
|
|
run: pnpm publish --access public --tag ${{steps.check_version.outputs.tag}}
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |