Skip to content

Commit cc259d1

Browse files
authored
chore(cicd): set npm publish
1 parent 0dae809 commit cc259d1

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

Diff for: .github/workflows/on-release.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch: {}
77
jobs:
88
publish:
9-
# if: github.event.pull_request.merged == true
9+
if: github.event.pull_request.merged == true
1010
runs-on: ubuntu-latest
1111

1212
steps:
@@ -25,10 +25,9 @@ jobs:
2525
npm ci
2626
npm run lerna-ci
2727
28-
# - name: "Setup npm"
29-
# run: |
30-
# npm set @xcanchal:registry=https://npm.pkg.github.com/xcanchal
31-
# npm set "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}"
28+
- name: "Setup npm"
29+
run: |
30+
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
3231
3332
- name: "Version and publish"
3433
env:
@@ -43,8 +42,8 @@ jobs:
4342
npx lerna version --conventional-commits --conventional-prerelease --preid beta --create-release github --yes
4443
fi
4544
46-
# npx lerna publish from-git --yes
47-
45+
npx lerna publish --no-verify-access from-git --yes
46+
4847
slack:
4948
name: Publish to slack channel
5049
needs:
@@ -53,11 +52,11 @@ jobs:
5352
steps:
5453
- name: publish latest release
5554
env:
56-
SLACK_URL: ${{ secrets.SLACK_URL }}
55+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
5756
run: |
5857
curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{ github.repository }}/releases/latest > release.json
5958
VERSION=$( jq -r '.name' release.json )
6059
CONTENT=$( jq -r '.body' release.json )
6160
jq -n --arg version "$VERSION" --arg content "$CONTENT" '{"release-version": $version, "release-content": $content}' > body.json
62-
curl --location --request POST $SLACK_URL \
63-
--header 'Content-Type: application/json' --data @body.json
61+
curl --location --request POST $SLACK_WEBHOOK_URL \
62+
--header 'Content-Type: application/json' --data @body.json

0 commit comments

Comments
 (0)