|
1 | | -name: Publish Package |
2 | | - |
3 | | -on: |
4 | | - push: |
5 | | - branches: [ main ] |
6 | | - workflow_dispatch: |
7 | | - |
8 | | -permissions: |
9 | | - contents: write |
10 | | - pull-requests: write |
11 | | - |
12 | | -jobs: |
13 | | - publish: |
14 | | - runs-on: ubuntu-latest |
15 | | - steps: |
16 | | - - uses: actions/checkout@v4 |
17 | | - with: |
18 | | - fetch-depth: 0 |
19 | | - |
20 | | - - name: Setup Node.js |
21 | | - uses: actions/setup-node@v4 |
22 | | - with: |
23 | | - node-version: '18.x' |
24 | | - registry-url: 'https://registry.npmjs.org' |
25 | | - |
26 | | - - name: Install dependencies |
27 | | - run: npm ci |
28 | | - |
29 | | - - name: Conventional Changelog Action |
30 | | - id: changelog |
31 | | - uses: TriPSs/conventional-changelog-action@v6 |
32 | | - with: |
33 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
34 | | - git-message: 'chore(release): {version}' |
35 | | - preset: | |
36 | | - { |
37 | | - "name": "custom", |
38 | | - "types": [ |
39 | | - {"type": "feat", "section": "Features"}, |
40 | | - {"type": "fix", "section": "Bug Fixes"}, |
41 | | - {"type": "chore", "section": "Maintenance"}, |
42 | | - {"type": "docs", "section": "Documentation"}, |
43 | | - {"type": "style", "section": "Styling"}, |
44 | | - {"type": "refactor", "section": "Code Refactoring"}, |
45 | | - {"type": "perf", "section": "Performance"}, |
46 | | - {"type": "test", "section": "Testing"}, |
47 | | - {"type": "ci", "section": "CI/CD"}, |
48 | | - {"type": "build", "section": "Build System"} |
49 | | - ] |
50 | | - } |
51 | | - tag-prefix: 'v' |
52 | | - output-file: 'CHANGELOG.md' |
53 | | - skip-version-file: false |
54 | | - skip-commit: false |
55 | | - skip-on-empty: false |
56 | | - git-user-name: ${{ secrets.CHANGELOG_GIT_NAME }} |
57 | | - git-user-email: ${{ secrets.CHANGELOG_GIT_EMAIL }} |
58 | | - |
59 | | - - name: Build |
60 | | - run: npm run build |
61 | | - |
62 | | - - name: Create Release |
63 | | - if: steps.changelog.outputs.skipped == 'false' |
64 | | - env: |
65 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
66 | | - run: | |
67 | | - gh release create v${{ steps.changelog.outputs.version }} \ |
68 | | - --title "Release v${{ steps.changelog.outputs.version }}" \ |
69 | | - --notes "${{ steps.changelog.outputs.clean_changelog }}" |
70 | | -
|
71 | | - - name: Publish to NPM |
72 | | - if: steps.changelog.outputs.skipped == 'false' |
73 | | - run: npm publish |
74 | | - env: |
75 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 1 | +name: Publish Package |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + pull-requests: write |
| 11 | + |
| 12 | +jobs: |
| 13 | + publish: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + fetch-depth: 0 |
| 19 | + |
| 20 | + - name: Setup Node.js |
| 21 | + uses: actions/setup-node@v4 |
| 22 | + with: |
| 23 | + node-version: '18.x' |
| 24 | + registry-url: 'https://registry.npmjs.org' |
| 25 | + |
| 26 | + - name: Install dependencies |
| 27 | + run: npm ci |
| 28 | + |
| 29 | + - name: Conventional Changelog Action |
| 30 | + id: changelog |
| 31 | + uses: TriPSs/conventional-changelog-action@v6 |
| 32 | + with: |
| 33 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 34 | + git-message: 'chore(release): {version}' |
| 35 | + config-file-path: '.github/conventional-changelog.config.js' |
| 36 | + tag-prefix: 'v' |
| 37 | + output-file: 'CHANGELOG.md' |
| 38 | + skip-version-file: false |
| 39 | + skip-commit: false |
| 40 | + skip-on-empty: false |
| 41 | + git-user-name: ${{ secrets.CHANGELOG_GIT_NAME }} |
| 42 | + git-user-email: ${{ secrets.CHANGELOG_GIT_EMAIL }} |
| 43 | + |
| 44 | + - name: Build |
| 45 | + run: npm run build |
| 46 | + |
| 47 | + - name: Create Release |
| 48 | + if: steps.changelog.outputs.skipped == 'false' |
| 49 | + env: |
| 50 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 51 | + run: | |
| 52 | + gh release create v${{ steps.changelog.outputs.version }} \ |
| 53 | + --title "Release v${{ steps.changelog.outputs.version }}" \ |
| 54 | + --notes "${{ steps.changelog.outputs.clean_changelog }}" |
| 55 | +
|
| 56 | + - name: Publish to NPM |
| 57 | + if: steps.changelog.outputs.skipped == 'false' |
| 58 | + run: npm publish |
| 59 | + env: |
| 60 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments