Skip to content

Commit fe99f17

Browse files
committed
Change release method
1 parent 634f64e commit fe99f17

4 files changed

Lines changed: 43 additions & 69 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,39 @@ on:
33
push:
44
tags:
55
- '*'
6-
permissions:
7-
contents: write
86
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
id-token: write
12+
steps:
13+
- name: Checkout the repository
14+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
15+
with:
16+
persist-credentials: false
17+
- name: Clean npm package
18+
uses: ai/clean-npm-project@3f664d1a83e04a2be737b7ad4e0b5a4e1b7dbc08 # v0.3.1
19+
with:
20+
clean-docs: true
21+
- name: Install Node.js
22+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
23+
with:
24+
node-version: 26
25+
package-manager-cache: false
26+
- name: Publish npm package
27+
run: npm stage publish
28+
working-directory: cleaned-project/
929
release:
10-
name: Release On Tag
11-
if: startsWith(github.ref, 'refs/tags/')
1230
runs-on: ubuntu-latest
31+
permissions:
32+
contents: write
1333
steps:
1434
- name: Checkout the repository
15-
uses: actions/checkout@v4
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@v2
35+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4036
with:
41-
name: ${{ github.ref_name }}
42-
body: '${{ steps.changelog.outputs.changelog_content }}'
43-
draft: false
44-
prerelease: false
37+
persist-credentials: false
38+
- name: Copy CHANGELOG.md to Releases
39+
uses: ai/copy-changelog-to-release@a6dc825c34575add2da2060796794f7b84894628 # v0.2.0
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.github/workflows/test.yml‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout the repository
15-
uses: actions/checkout@v4
16-
- name: Install pnpm
17-
uses: pnpm/action-setup@v4
15+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1816
with:
19-
version: 9
20-
- name: Install Node.js
21-
uses: actions/setup-node@v4
17+
persist-credentials: false
18+
- name: Install Node.js & pnpm
19+
uses: pnpm/setup@703c52620218391530e48b9e8870d5c0082e1b9b # v2.1.0
2220
with:
23-
node-version: 22
24-
cache: pnpm
21+
version: 12
22+
runtime: node@26
2523
- name: Install dependencies
2624
run: pnpm install --ignore-scripts
2725
- name: Run tests
@@ -31,18 +29,22 @@ jobs:
3129
strategy:
3230
matrix:
3331
node-version:
32+
- 24
33+
- 22
3434
- 20
3535
- 18
3636
name: Node.js ${{ matrix.node-version }} Quick
3737
steps:
3838
- name: Checkout the repository
39-
uses: actions/checkout@v4
39+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
40+
with:
41+
persist-credentials: false
4042
- name: Install pnpm
41-
uses: pnpm/action-setup@v4
43+
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
4244
with:
4345
version: 9
4446
- name: Install Node.js ${{ matrix.node-version }}
45-
uses: actions/setup-node@v4
47+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
4648
with:
4749
node-version: ${{ matrix.node-version }}
4850
cache: pnpm

‎package.json‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
},
4343
"devDependencies": {
4444
"@logux/eslint-config": "^53.4.0",
45-
"clean-publish": "^5.0.0",
4645
"eslint": "^9.11.1",
4746
"postcss": "^8.4.47",
4847
"postcss-parser-tests": "^8.8.0"
@@ -54,8 +53,5 @@
5453
"semi": false,
5554
"singleQuote": true,
5655
"trailingComma": "none"
57-
},
58-
"clean-publish": {
59-
"cleanDocs": true
6056
}
6157
}

‎pnpm-lock.yaml‎

Lines changed: 0 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)