Skip to content

Commit 0cd6b4f

Browse files
author
mayintao3
committed
chore(release): publish 1.0.22
1 parent 859aa90 commit 0cd6b4f

File tree

14 files changed

+113
-23
lines changed

14 files changed

+113
-23
lines changed

.github/workflows/CI.yml

+83-11
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,40 @@ jobs:
408408
name: bindings-universal-apple-darwin
409409
path: ${{ env.APP_NAME }}.*.node
410410
if-no-files-found: error
411+
412+
need-publish:
413+
permissions:
414+
actions: write # to cancel running workflow (andymckay/cancel-action)
415+
name: Need Publish
416+
runs-on: ubuntu-latest
417+
outputs:
418+
ABORT: ${{ env.ABORT }}
419+
env:
420+
ABORT: false
421+
COMMIT_MESSAGE: ''
422+
steps:
423+
# Setup
424+
- name: Checkout
425+
uses: actions/checkout@v4
426+
427+
# Log meta
428+
- name : GITHUB CONTEXT
429+
env:
430+
GITHUB_CONTEXT: ${{ toJson(github) }}
431+
run: echo "$GITHUB_CONTEXT"
432+
433+
# Get commit message
434+
- name: Get commit message
435+
run: |
436+
COMMIT_MESSAGE=$(git log --format=%s -n 1)
437+
echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV
438+
- name: Show commit message
439+
run : echo "$COMMIT_MESSAGE"
440+
441+
- name: Commit message compliance verification
442+
if: startsWith( env.COMMIT_MESSAGE , 'chore(release):' ) != true
443+
run: echo "ABORT=true" >> $GITHUB_ENV
444+
411445
publish:
412446
name: Publish
413447
runs-on: ubuntu-latest
@@ -419,6 +453,11 @@ jobs:
419453
- test-linux-aarch64-musl-binding
420454
- test-linux-arm-gnueabihf-binding
421455
- universal-macOS
456+
- need-publish
457+
if: needs.need-publish.outputs.ABORT != 'true'
458+
env:
459+
CURRENT_VERSION: ''
460+
PUBLISH_PARAMS: ''
422461
steps:
423462
- name: Checkout
424463
uses: actions/checkout@v4
@@ -442,20 +481,53 @@ jobs:
442481
- name: List packages
443482
run: ls -R ./npm
444483
shell: bash
445-
- name: Publish
484+
485+
# Log meta
486+
- name : GITHUB CONTEXT
487+
env:
488+
GITHUB_CONTEXT: ${{ toJson(github) }}
489+
run: echo "$GITHUB_CONTEXT"
490+
491+
# Get commit message
492+
- name: Get commit message
446493
run: |
447-
npm config set provenance true
448-
if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
449-
then
450-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
451-
npm publish --access public
452-
elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
453-
then
454-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
455-
npm publish --tag next --access public
494+
COMMIT_MESSAGE=$(git log --format=%s -n 1)
495+
echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV
496+
497+
# Get & check npm publish
498+
- name: Get publish params
499+
run: |
500+
PUBLISH_PARAMS=`echo $COMMIT_MESSAGE | grep -oE "^chore\(release\): publish \S*\s(.*)" | cut -d " " -f 4-`
501+
echo "PUBLISH_PARAMS=${PUBLISH_PARAMS}" >> $GITHUB_ENV
502+
echo "Publish pushing provide parameter [$PUBLISH_PARAMS]."
503+
504+
# Define ${CURRENT_VERSION}
505+
- name: Set Current Version
506+
shell: bash -ex {0}
507+
run: |
508+
CURRENT_VERSION=$(node -p 'require("./package.json").version')
509+
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
510+
511+
# Check git tag
512+
- name: Tag Check
513+
id: tag_check
514+
shell: bash -ex {0}
515+
run: |
516+
GET_API_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/git/ref/tags/v${CURRENT_VERSION}"
517+
http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s \
518+
-H "Authorization: token ${GITHUB_TOKEN}")
519+
if [ "$http_status_code" -ne "404" ] ; then
520+
echo "::set-output name=exists_tag::true"
456521
else
457-
echo "Not a release, skipping publish"
522+
echo "::set-output name=exists_tag::false"
458523
fi
459524
env:
460525
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
526+
527+
- name: Publish
528+
run: |
529+
npm config set provenance true
530+
pnpm publish --registry=https://registry.npmjs.org/ --publish-branch=${{ github.ref_name }} -r ${{ env.PUBLISH_PARAMS }}
531+
env:
532+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
461533
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

CHANGELOG.md

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## [1.0.22](https://github.com/NervJS/parse-css-to-stylesheet/compare/v1.0.21...v1.0.22) (2024-09-25)
2+
3+
4+
### Bug Fixes
5+
6+
* update ci workflow ([c0a87a6](https://github.com/NervJS/parse-css-to-stylesheet/commit/c0a87a695cc000131282cd850b96036e9e7a98aa))
7+
8+
9+
### Features
10+
11+
* add registry ([f4b8ce7](https://github.com/NervJS/parse-css-to-stylesheet/commit/f4b8ce76a15f22442105fa8a2b5fd2718722170b))
12+
* rm node 16 ([ec7dbfc](https://github.com/NervJS/parse-css-to-stylesheet/commit/ec7dbfcb6d4edd96b9f16fdc1dbd2511ff103702))
13+
* use checkout v4 ([859aa90](https://github.com/NervJS/parse-css-to-stylesheet/commit/859aa90b673a3ac254be38b9bdfcde0c12824e9f))
14+
* use npm test ([8b72c6b](https://github.com/NervJS/parse-css-to-stylesheet/commit/8b72c6b69444f9a4c4055cb0238803b666d69711))
15+
* use pnpm ci ([66f1f9e](https://github.com/NervJS/parse-css-to-stylesheet/commit/66f1f9e05768d59104dbc1e7e0ddc4f1ea049697))
16+
17+
18+
119
## [1.0.21](https://github.com/NervJS/parse-css-to-stylesheet/compare/v1.0.20...v1.0.21) (2024-09-25)
220

321

npm/android-arm-eabi/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tarojs/parse-css-to-stylesheet-android-arm-eabi",
3-
"version": "1.0.21",
3+
"version": "1.0.22",
44
"os": [
55
"android"
66
],

npm/android-arm64/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tarojs/parse-css-to-stylesheet-android-arm64",
3-
"version": "1.0.21",
3+
"version": "1.0.22",
44
"os": [
55
"android"
66
],

npm/darwin-arm64/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tarojs/parse-css-to-stylesheet-darwin-arm64",
3-
"version": "1.0.21",
3+
"version": "1.0.22",
44
"os": [
55
"darwin"
66
],

npm/darwin-universal/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tarojs/parse-css-to-stylesheet-darwin-universal",
3-
"version": "1.0.21",
3+
"version": "1.0.22",
44
"os": [
55
"darwin"
66
],

npm/darwin-x64/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tarojs/parse-css-to-stylesheet-darwin-x64",
3-
"version": "1.0.21",
3+
"version": "1.0.22",
44
"os": [
55
"darwin"
66
],

npm/linux-arm-gnueabihf/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tarojs/parse-css-to-stylesheet-linux-arm-gnueabihf",
3-
"version": "1.0.21",
3+
"version": "1.0.22",
44
"os": [
55
"linux"
66
],

npm/linux-arm64-gnu/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tarojs/parse-css-to-stylesheet-linux-arm64-gnu",
3-
"version": "1.0.21",
3+
"version": "1.0.22",
44
"os": [
55
"linux"
66
],

npm/linux-arm64-musl/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tarojs/parse-css-to-stylesheet-linux-arm64-musl",
3-
"version": "1.0.21",
3+
"version": "1.0.22",
44
"os": [
55
"linux"
66
],

npm/linux-x64-gnu/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tarojs/parse-css-to-stylesheet-linux-x64-gnu",
3-
"version": "1.0.21",
3+
"version": "1.0.22",
44
"os": [
55
"linux"
66
],

npm/linux-x64-musl/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tarojs/parse-css-to-stylesheet-linux-x64-musl",
3-
"version": "1.0.21",
3+
"version": "1.0.22",
44
"os": [
55
"linux"
66
],

npm/win32-x64-msvc/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tarojs/parse-css-to-stylesheet-win32-x64-msvc",
3-
"version": "1.0.21",
3+
"version": "1.0.22",
44
"os": [
55
"win32"
66
],

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tarojs/parse-css-to-stylesheet",
3-
"version": "1.0.21",
3+
"version": "1.0.22",
44
"main": "index.js",
55
"types": "index.d.ts",
66
"napi": {

0 commit comments

Comments
 (0)