Skip to content

Commit

Permalink
chore: use bumpp for releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Sep 17, 2024
1 parent f25a9db commit 2beb883
Show file tree
Hide file tree
Showing 5 changed files with 402 additions and 56 deletions.
37 changes: 6 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ name: CI

on:
push:
branches: [main, dev]
branches:
- main

pull_request:
branches: [main, dev]
branches:
- main

jobs:
test:
Expand All @@ -20,7 +23,7 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4.0.0
name: Install pnpm

- uses: actions/setup-node@v4
Expand All @@ -34,31 +37,3 @@ jobs:
# Runs a set of commands using the runners shell
- name: Build and Test
run: pnpm test

release:
runs-on: ubuntu-latest
needs: [test]
if: "!contains(github.event.head_commit.message, 'skip-release') && !contains(github.event.head_commit.message, 'skip-ci') && github.event_name != 'pull_request'"
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
name: Install pnpm

- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm

- run: pnpm i

- run: pnpx semantic-release --branches main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

permissions:
contents: write
id-token: write

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set node
uses: actions/setup-node@v4
with:
node-version: lts/*

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Dependencies
run: pnpm i

- name: Publish to NPM
run: pnpm -r publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
21 changes: 0 additions & 21 deletions .releaserc.json

This file was deleted.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tsup",
"version": "0.0.0-semantic-release",
"version": "8.3.0",
"packageManager": "[email protected]",
"description": "Bundle your TypeScript library with no config, powered by esbuild",
"license": "MIT",
Expand All @@ -27,7 +27,8 @@
"test": "npm run build && npm run test-only",
"format": "prettier --write .",
"test-only": "vitest run",
"build-fast": "npm run build -- --no-dts"
"build-fast": "npm run build -- --no-dts",
"release": "bumpp"
},
"peerDependencies": {
"@microsoft/api-extractor": "^7.36.0",
Expand Down Expand Up @@ -75,6 +76,7 @@
"@types/fs-extra": "11.0.4",
"@types/node": "20.14.11",
"@types/resolve": "1.20.6",
"bumpp": "^9.5.2",
"flat": "6.0.1",
"fs-extra": "11.2.0",
"postcss": "8.4.39",
Expand Down
Loading

0 comments on commit 2beb883

Please sign in to comment.