|
3 | 3 | push: |
4 | 4 | tags: |
5 | 5 | - '*' |
6 | | -permissions: |
7 | | - contents: write |
8 | 6 | jobs: |
9 | | - release: |
10 | | - name: Release On Tag |
11 | | - if: startsWith(github.ref, 'refs/tags/') |
| 7 | + publish: |
12 | 8 | runs-on: ubuntu-latest |
| 9 | + permissions: |
| 10 | + contents: read |
| 11 | + id-token: write |
13 | 12 | steps: |
14 | 13 | - name: Checkout the repository |
15 | 14 | uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
16 | | - - name: Extract the changelog |
17 | | - id: changelog |
18 | | - run: | |
19 | | - TAG_NAME=${GITHUB_REF/refs\/tags\//} |
20 | | - READ_SECTION=false |
21 | | - CHANGELOG="" |
22 | | - while IFS= read -r line; do |
23 | | - if [[ "$line" =~ ^#+\ +(.*) ]]; then |
24 | | - if [[ "${BASH_REMATCH[1]}" == "$TAG_NAME" ]]; then |
25 | | - READ_SECTION=true |
26 | | - elif [[ "$READ_SECTION" == true ]]; then |
27 | | - break |
28 | | - fi |
29 | | - elif [[ "$READ_SECTION" == true ]]; then |
30 | | - CHANGELOG+="$line"$'\n' |
31 | | - fi |
32 | | - done < "CHANGELOG.md" |
33 | | - CHANGELOG=$(echo "$CHANGELOG" | awk '/./ {$1=$1;print}') |
34 | | - echo "changelog_content<<EOF" >> $GITHUB_OUTPUT |
35 | | - echo "$CHANGELOG" >> $GITHUB_OUTPUT |
36 | | - echo "EOF" >> $GITHUB_OUTPUT |
37 | | - - name: Create the release |
38 | | - if: steps.changelog.outputs.changelog_content != '' |
39 | | - uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1 |
| 15 | + - name: Clean npm package |
| 16 | + uses: ai/clean-npm-project@0e1fd6e68c39b972235226864d47e368c550ebed # v0.2.3 |
| 17 | + with: |
| 18 | + clean-docs: true |
| 19 | + - name: Install Node.js |
| 20 | + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 |
40 | 21 | with: |
41 | | - name: ${{ github.ref_name }} |
42 | | - body: '${{ steps.changelog.outputs.changelog_content }}' |
43 | | - draft: false |
44 | | - prerelease: false |
| 22 | + node-version: 26 |
| 23 | + - name: Publish npm package |
| 24 | + run: npm stage publish |
| 25 | + working-directory: cleaned-project/ |
| 26 | + release: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + permissions: |
| 29 | + contents: write |
| 30 | + steps: |
| 31 | + - name: Checkout the repository |
| 32 | + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 33 | + - name: Clean npm package |
| 34 | + uses: ai/copy-changelog-to-release@a6dc825c34575add2da2060796794f7b84894628 # v0.2.0 |
| 35 | + env: |
| 36 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments