Skip to content

Commit 41952da

Browse files
committed
ci: release on CI
1 parent 6a8f124 commit 41952da

File tree

6 files changed

+42
-98
lines changed

6 files changed

+42
-98
lines changed

.github/workflows/release-commit.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Publish Any Commit
2+
on: [push, pull_request]
3+
4+
permissions: {}
5+
6+
jobs:
7+
release:
8+
uses: sxzz/workflows/.github/workflows/release-commit.yml@v1
9+
with:
10+
compact: true

.github/workflows/release.yml

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,21 @@
11
name: Release
22

3-
permissions:
4-
contents: write
5-
63
on:
74
push:
85
tags:
96
- 'v*'
107

118
jobs:
129
release:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v5
16-
with:
17-
fetch-depth: 0
18-
19-
- name: Set node
20-
uses: actions/setup-node@v4
21-
with:
22-
node-version: lts/*
23-
24-
- run: npx changelogithub
25-
env:
26-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
27-
28-
publish-jsr:
29-
runs-on: ubuntu-latest
10+
uses: sxzz/workflows/.github/workflows/release.yml@v1
11+
with:
12+
publish: true
13+
permissions:
14+
contents: write
15+
id-token: write
3016

17+
release-jsr:
18+
uses: sxzz/workflows/.github/workflows/release-jsr.yml@v1
3119
permissions:
3220
contents: read
3321
id-token: write
34-
35-
steps:
36-
- uses: actions/checkout@v5
37-
38-
- name: Install pnpm
39-
uses: pnpm/[email protected]
40-
41-
- name: Set node
42-
uses: actions/setup-node@v4
43-
with:
44-
node-version: lts/*
45-
cache: pnpm
46-
47-
- name: Install
48-
run: pnpm i
49-
50-
- name: Publish package
51-
run: npx jsr publish

.github/workflows/unit-test.yml

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,13 @@
11
name: Unit Test
22

3+
permissions: {}
4+
35
on:
46
push:
57
branches: [main]
68
pull_request:
79
branches: [main]
810

911
jobs:
10-
lint:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v5
15-
16-
- name: Install pnpm
17-
uses: pnpm/[email protected]
18-
19-
- name: Set node
20-
uses: actions/setup-node@v4
21-
with:
22-
node-version: lts/*
23-
cache: pnpm
24-
25-
- name: Install
26-
run: pnpm i
27-
28-
- name: Lint
29-
run: pnpm lint
30-
31-
- name: Typecheck
32-
run: pnpm typecheck
33-
34-
test:
35-
runs-on: ${{ matrix.os }}
36-
37-
strategy:
38-
matrix:
39-
os: [ubuntu-latest, windows-latest]
40-
node: [18, 20, 22]
41-
fail-fast: false
42-
43-
steps:
44-
- name: Checkout
45-
uses: actions/checkout@v5
46-
47-
- name: Install pnpm
48-
uses: pnpm/[email protected]
49-
50-
- name: Set node ${{ matrix.node }}
51-
uses: actions/setup-node@v4
52-
with:
53-
node-version: ${{ matrix.node }}
54-
cache: pnpm
55-
56-
- name: Install
57-
run: pnpm i
58-
59-
- name: Build
60-
run: pnpm run build
61-
62-
- name: Test
63-
run: pnpm run test
12+
unit-test:
13+
uses: sxzz/workflows/.github/workflows/unit-test.yml@v1

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright © 2024-PRESENT 三咲智子 (https://github.com/sxzz)
3+
Copyright © 2024-PRESENT Kevin Deng (https://github.com/sxzz)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# unplugin-replace [![npm](https://img.shields.io/npm/v/unplugin-replace.svg)](https://npmjs.com/package/unplugin-replace) [![JSR](https://jsr.io/badges/@unplugin/replace)](https://jsr.io/@unplugin/replace)
1+
# unplugin-replace
22

3-
[![Unit Test](https://github.com/unplugin/unplugin-replace/actions/workflows/unit-test.yml/badge.svg)](https://github.com/unplugin/unplugin-replace/actions/workflows/unit-test.yml)
3+
[![npm version][npm-version-src]][npm-version-href]
4+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
5+
[![JSR][jsr-src]][jsr-href]
6+
[![Unit Test][unit-test-src]][unit-test-href]
47

58
🍣 A universal bundler plugin which replaces targeted strings in files, based on [@rollup/plugin-replace](https://www.npmjs.com/package/@rollup/plugin-replace).
69

@@ -126,4 +129,15 @@ Replace({
126129
127130
## License
128131
129-
[MIT](./LICENSE) License © 2024-PRESENT [三咲智子](https://github.com/sxzz)
132+
[MIT](./LICENSE) License © 2024-PRESENT [Kevin Deng](https://github.com/sxzz)
133+
134+
<!-- Badges -->
135+
136+
[npm-version-src]: https://img.shields.io/npm/v/unplugin-replace.svg
137+
[npm-version-href]: https://npmjs.com/package/unplugin-replace
138+
[npm-downloads-src]: https://img.shields.io/npm/dm/unplugin-replace
139+
[npm-downloads-href]: https://www.npmcharts.com/compare/unplugin-replace?interval=30
140+
[jsr-src]: https://jsr.io/badges/@unplugin/replace
141+
[jsr-href]: https://jsr.io/@unplugin/replace
142+
[unit-test-src]: https://github.com/unplugin/unplugin-replace/actions/workflows/unit-test.yml/badge.svg
143+
[unit-test-href]: https://github.com/unplugin/unplugin-replace/actions/workflows/unit-test.yml

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"type": "git",
2121
"url": "git+https://github.com/unplugin/unplugin-replace.git"
2222
},
23-
"author": "三咲智子 Kevin Deng <[email protected]>",
23+
"author": "Kevin Deng <[email protected]>",
2424
"funding": "https://github.com/sponsors/sxzz",
2525
"files": [
2626
"dist"
@@ -57,7 +57,7 @@
5757
"dev": "tsdown --watch",
5858
"test": "vitest",
5959
"typecheck": "tsc --noEmit",
60-
"release": "bumpp && pnpm publish",
60+
"release": "bumpp",
6161
"prepublishOnly": "pnpm run build"
6262
},
6363
"dependencies": {

0 commit comments

Comments
 (0)