File tree 4 files changed +195
-0
lines changed
4 files changed +195
-0
lines changed Original file line number Diff line number Diff line change 40
40
41
41
- name : Build
42
42
run : pnpm run build
43
+
44
+ - name : Publish (development)
45
+ if : github.repository == 'RightCapitalHQ/php-parser' && github.base_ref == github.event.repository.default_branch
46
+ env :
47
+ NPM_TOKEN : ${{ secrets.NPM_PUBLISH_TOKEN }}
48
+ run : |
49
+ npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
50
+ preid=$(sed -e s:/:-:g <<<${{ github.head_ref }}).${{ github.run_number }}.${{ github.run_attempt }}
51
+ npm --no-git-tag-version version prerelease --preid="${preid}"
52
+ pnpm publish --no-git-checks --access public --tag development
53
+
54
+ - name : Publish (main)
55
+ if : github.repository == 'RightCapitalHQ/php-parser' && github.ref_name == github.event.repository.default_branch
56
+ env :
57
+ NPM_TOKEN : ${{ secrets.NPM_PUBLISH_TOKEN }}
58
+ run : |
59
+ npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
60
+ git config --local user.email "[email protected] "
61
+ git config --local user.name "GitHub Actions[bot]"
62
+ pnpm beachball publish --access public --yes -m 'chore(release): applying package updates'
Original file line number Diff line number Diff line change
1
+ // @ts -check
2
+ /** @type {import('beachball').BeachballConfig } */
3
+ module . exports = {
4
+ registry : 'https://registry.npmjs.org' ,
5
+ ignorePatterns : [
6
+ '.*ignore' ,
7
+ 'prettier.config.cjs' ,
8
+ '.eslintrc.cjs' ,
9
+ 'jest.*.js' ,
10
+ '.pnpm-store/**' ,
11
+ '.vscode/**' ,
12
+ 'pnpm-lock.yaml' ,
13
+ ] ,
14
+ changelog : {
15
+ customRenderers : {
16
+ renderHeader ( ) { } ,
17
+ renderChangeTypeHeader ( changeType , renderInfo ) {
18
+ const changelogDate = renderInfo . newVersionChangelog . date
19
+ . toLocaleDateString ( 'zh-CN' )
20
+ . replace ( / \/ / g, '-' ) ;
21
+ const heading =
22
+ changeType === 'major' || changeType === 'minor' ? '##' : '###' ;
23
+ return `${ heading } [${ renderInfo . newVersionChangelog . version } ](https://github.com/RightCapitalHQ/phpdoc-parser/tree/${ renderInfo . newVersionChangelog . tag } ) (${ changelogDate } )` ;
24
+ } ,
25
+ // Original template: https://github.com/microsoft/beachball/blob/aefbc1ac37ee85961cc787133c827f1fd3925550/src/changelog/renderPackageChangelog.ts#L93
26
+ renderEntry ( entry ) {
27
+ if ( entry . author === 'beachball' ) {
28
+ return `- ${ entry . comment } ` ;
29
+ }
30
+ // Imitate GitHub's commit format https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls#commit-shas
31
+ return `- ${ entry . comment } ([${ entry . commit . substring (
32
+ 0 ,
33
+ 7 ,
34
+ ) } ](https://github.com/RightCapitalHQ/phpdoc-parser/commit/${
35
+ entry . commit
36
+ } ))`;
37
+ } ,
38
+ } ,
39
+ } ,
40
+ } ;
Original file line number Diff line number Diff line change 6
6
"scripts" : {
7
7
"commit" : " cz" ,
8
8
"clean" : " tsc --build --clean ./tsconfig.build.json" ,
9
+ "change" : " beachball change --no-commit" ,
10
+ "check" : " beachball check" ,
9
11
"build" : " pnpm run clean && tsc --project ./tsconfig.build.json" ,
10
12
"eslint" : " eslint --report-unused-disable-directives 'src/**/*.ts*'" ,
11
13
"eslint:fix" : " eslint --report-unused-disable-directives --fix 'src/**/*.ts*'" ,
49
51
"@types/lodash" : " 4.14.198" ,
50
52
"@types/mustache" : " 4.2.2" ,
51
53
"@types/node" : " 20.6.0" ,
54
+ "beachball" : " 2.37.0" ,
52
55
"husky" : " 8.0.3"
53
56
},
54
57
"config" : {
You can’t perform that action at this time.
0 commit comments