Skip to content

Commit

Permalink
chore(release): publish 1.0.22
Browse files Browse the repository at this point in the history
  • Loading branch information
mayintao3 committed Sep 25, 2024
1 parent 859aa90 commit 0cd6b4f
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 23 deletions.
94 changes: 83 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,40 @@ jobs:
name: bindings-universal-apple-darwin
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error

need-publish:
permissions:
actions: write # to cancel running workflow (andymckay/cancel-action)
name: Need Publish
runs-on: ubuntu-latest
outputs:
ABORT: ${{ env.ABORT }}
env:
ABORT: false
COMMIT_MESSAGE: ''
steps:
# Setup
- name: Checkout
uses: actions/checkout@v4

# Log meta
- name : GITHUB CONTEXT
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

# Get commit message
- name: Get commit message
run: |
COMMIT_MESSAGE=$(git log --format=%s -n 1)
echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV
- name: Show commit message
run : echo "$COMMIT_MESSAGE"

- name: Commit message compliance verification
if: startsWith( env.COMMIT_MESSAGE , 'chore(release):' ) != true
run: echo "ABORT=true" >> $GITHUB_ENV

publish:
name: Publish
runs-on: ubuntu-latest
Expand All @@ -419,6 +453,11 @@ jobs:
- test-linux-aarch64-musl-binding
- test-linux-arm-gnueabihf-binding
- universal-macOS
- need-publish
if: needs.need-publish.outputs.ABORT != 'true'
env:
CURRENT_VERSION: ''
PUBLISH_PARAMS: ''
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -442,20 +481,53 @@ jobs:
- name: List packages
run: ls -R ./npm
shell: bash
- name: Publish

# Log meta
- name : GITHUB CONTEXT
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

# Get commit message
- name: Get commit message
run: |
npm config set provenance true
if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish --access public
elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish --tag next --access public
COMMIT_MESSAGE=$(git log --format=%s -n 1)
echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV
# Get & check npm publish
- name: Get publish params
run: |
PUBLISH_PARAMS=`echo $COMMIT_MESSAGE | grep -oE "^chore\(release\): publish \S*\s(.*)" | cut -d " " -f 4-`
echo "PUBLISH_PARAMS=${PUBLISH_PARAMS}" >> $GITHUB_ENV
echo "Publish pushing provide parameter [$PUBLISH_PARAMS]."
# Define ${CURRENT_VERSION}
- name: Set Current Version
shell: bash -ex {0}
run: |
CURRENT_VERSION=$(node -p 'require("./package.json").version')
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
# Check git tag
- name: Tag Check
id: tag_check
shell: bash -ex {0}
run: |
GET_API_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/git/ref/tags/v${CURRENT_VERSION}"
http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s \
-H "Authorization: token ${GITHUB_TOKEN}")
if [ "$http_status_code" -ne "404" ] ; then
echo "::set-output name=exists_tag::true"
else
echo "Not a release, skipping publish"
echo "::set-output name=exists_tag::false"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish
run: |
npm config set provenance true
pnpm publish --registry=https://registry.npmjs.org/ --publish-branch=${{ github.ref_name }} -r ${{ env.PUBLISH_PARAMS }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## [1.0.22](https://github.com/NervJS/parse-css-to-stylesheet/compare/v1.0.21...v1.0.22) (2024-09-25)


### Bug Fixes

* update ci workflow ([c0a87a6](https://github.com/NervJS/parse-css-to-stylesheet/commit/c0a87a695cc000131282cd850b96036e9e7a98aa))


### Features

* add registry ([f4b8ce7](https://github.com/NervJS/parse-css-to-stylesheet/commit/f4b8ce76a15f22442105fa8a2b5fd2718722170b))
* rm node 16 ([ec7dbfc](https://github.com/NervJS/parse-css-to-stylesheet/commit/ec7dbfcb6d4edd96b9f16fdc1dbd2511ff103702))
* use checkout v4 ([859aa90](https://github.com/NervJS/parse-css-to-stylesheet/commit/859aa90b673a3ac254be38b9bdfcde0c12824e9f))
* use npm test ([8b72c6b](https://github.com/NervJS/parse-css-to-stylesheet/commit/8b72c6b69444f9a4c4055cb0238803b666d69711))
* use pnpm ci ([66f1f9e](https://github.com/NervJS/parse-css-to-stylesheet/commit/66f1f9e05768d59104dbc1e7e0ddc4f1ea049697))



## [1.0.21](https://github.com/NervJS/parse-css-to-stylesheet/compare/v1.0.20...v1.0.21) (2024-09-25)


Expand Down
2 changes: 1 addition & 1 deletion npm/android-arm-eabi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/parse-css-to-stylesheet-android-arm-eabi",
"version": "1.0.21",
"version": "1.0.22",
"os": [
"android"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/android-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/parse-css-to-stylesheet-android-arm64",
"version": "1.0.21",
"version": "1.0.22",
"os": [
"android"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/parse-css-to-stylesheet-darwin-arm64",
"version": "1.0.21",
"version": "1.0.22",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-universal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/parse-css-to-stylesheet-darwin-universal",
"version": "1.0.21",
"version": "1.0.22",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/parse-css-to-stylesheet-darwin-x64",
"version": "1.0.21",
"version": "1.0.22",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-arm-gnueabihf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/parse-css-to-stylesheet-linux-arm-gnueabihf",
"version": "1.0.21",
"version": "1.0.22",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/parse-css-to-stylesheet-linux-arm64-gnu",
"version": "1.0.21",
"version": "1.0.22",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-arm64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/parse-css-to-stylesheet-linux-arm64-musl",
"version": "1.0.21",
"version": "1.0.22",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/parse-css-to-stylesheet-linux-x64-gnu",
"version": "1.0.21",
"version": "1.0.22",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/parse-css-to-stylesheet-linux-x64-musl",
"version": "1.0.21",
"version": "1.0.22",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/parse-css-to-stylesheet-win32-x64-msvc",
"version": "1.0.21",
"version": "1.0.22",
"os": [
"win32"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/parse-css-to-stylesheet",
"version": "1.0.21",
"version": "1.0.22",
"main": "index.js",
"types": "index.d.ts",
"napi": {
Expand Down

0 comments on commit 0cd6b4f

Please sign in to comment.