Skip to content

Commit 645b727

Browse files
Update publish.yml
1 parent 645466d commit 645b727

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Publish
2-
32
on:
43
release:
5-
types: [published, edited]
4+
types: published
5+
permissions:
6+
contents: write
67

78
jobs:
89
build:
@@ -11,15 +12,12 @@ jobs:
1112
outputs:
1213
tag: ${{ steps.update-package-version.outputs.version }}
1314
steps:
14-
# Configure runner with the right stuff
15-
- uses: actions/checkout@v3
16-
with:
17-
token: ${{ secrets.GITHUB_TOKEN }}
15+
- uses: actions/checkout@v5
1816
- name: Configure git
1917
run: |
2018
git config user.name 'Release Action'
2119
git config user.email '<>'
22-
- uses: actions/setup-node@v3
20+
- uses: actions/setup-node@v5
2321
with:
2422
node-version: 20
2523

@@ -31,7 +29,6 @@ jobs:
3129
run: |
3230
git tag -d "${{ github.event.release.tag_name }}"
3331
VERSION=$(npm version "${{ github.event.release.tag_name }}" --no-git-tag-version)
34-
echo "::set-output name=version::$VERSION"
3532
git add package.json package-lock.json
3633
git commit -m "[skip ci] Bump $VERSION"
3734
git push origin HEAD:main
@@ -47,15 +44,15 @@ jobs:
4744
id: release_info
4845
run: |
4946
# Check for semantic versioning
50-
echo "Preparing release for version $longVersion"
5147
longVersion="${{github.event.release.tag_name}}"
48+
echo "Preparing release for version $longVersion"
5249
[[ $longVersion == v[0-9]*.[0-9]*.[0-9]* ]] || (echo "must follow semantic versioning" && exit 1)
5350
majorVersion=$(echo ${longVersion%.*.*})
5451
minorVersion=$(echo ${longVersion%.*})
5552
56-
# Add the built artifacts. Using --force because dist should be in
53+
# Add the built artifacts. Using --force because dist/lib should be in
5754
# .gitignore
58-
git add --force dist
55+
git add --force dist lib
5956
6057
# Make the commit
6158
MESSAGE="Build for $(git rev-parse --short HEAD)"

0 commit comments

Comments
 (0)