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: tags:
- 'v*' - 'v*'
permissions:
contents: write
jobs: jobs:
release: release:
permissions:
contents: write
id-token: write
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 20.x node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- run: pnpm install - run: npx changelogithub
- 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: 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", "build": "turbo --filter \"./packages/*\" build",
"dev": "turbo --filter \"./packages/*\" dev", "dev": "turbo --filter \"./packages/*\" dev",
"clean": "turbo --filter \"./packages/*\" clean && rm -rf node_modules", "clean": "turbo --filter \"./packages/*\" clean && rm -rf node_modules",
"bump": "bumpp -r",
"format": "biome format . --write", "format": "biome format . --write",
"lint": "biome check .", "lint": "biome check .",
"lint:fix": "biome check . --apply", "lint:fix": "biome check . --apply",
"release": "turbo --filter \"./packages/*\" typecheck && build && bumpp -r", "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", "test": "turbo --filter \"./packages/*\" test",
"typecheck": "turbo --filter \"./packages/*\" typecheck", "typecheck": "turbo --filter \"./packages/*\" typecheck",
"knip": "turbo --filter \"./packages/*\" knip" "knip": "turbo --filter \"./packages/*\" knip"