chore: release workflow should only release a changelog

This commit is contained in:
Bereket Engida
2024-09-02 23:51:12 +03:00
parent b3299b8019
commit 597ff196ca
3 changed files with 20 additions and 37 deletions

View File

@@ -5,46 +5,21 @@ on:
tags:
- 'v*'
jobs:
permissions:
contents: write
jobs:
release:
permissions:
contents: write
id-token: write
runs-on: ubuntu-latest
steps:
steps:
- uses: actions/checkout@v4
with:
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- run: pnpm install
- name: Build
run: pnpm build
- name: Check version
id: check_version
run: |
tag=$(echo ${GITHUB_REF#refs/tags/})
if [[ $tag == *"beta"* ]]; then
echo "::set-output name=tag::beta"
elif [[ $tag == *"alpha"* ]]; then
echo "::set-output name=tag::alpha"
else
echo "::set-output name=tag::latest"
fi
- name: Publish to npm
run: pnpm -r publish --access public --no-git-checks --tag ${{steps.check_version.outputs.tag}}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

8
bump.config.ts Normal file
View File

@@ -0,0 +1,8 @@
import { defineConfig } from "bumpp";
import fg from "fast-glob";
export default defineConfig({
files: fg.sync(["./packages/*/package.json"], {
ignore: ["./packages/*-extension/package.json"],
}),
});

View File

@@ -8,11 +8,11 @@
"build": "turbo --filter \"./packages/*\" build",
"dev": "turbo --filter \"./packages/*\" dev",
"clean": "turbo --filter \"./packages/*\" clean && rm -rf node_modules",
"bump": "bumpp -r",
"format": "biome format . --write",
"lint": "biome check .",
"lint:fix": "biome check . --apply",
"release": "turbo --filter \"./packages/*\" typecheck && build && bumpp -r",
"release:beta": "bumpp && nr build && pnpm -r publish --access public --tag beta",
"test": "turbo --filter \"./packages/*\" test",
"typecheck": "turbo --filter \"./packages/*\" typecheck",
"knip": "turbo --filter \"./packages/*\" knip"