From 0d36353b90f13c4dfb702ce0299870ef6aa9d417 Mon Sep 17 00:00:00 2001
From: jaywcjlove <398188662@qq.com>
Date: Wed, 1 Mar 2023 21:41:34 +0800
Subject: [PATCH] chore: update workflows config.
---
.github/workflows/ci.yml | 113 +++++++++++++++++++++------------------
1 file changed, 60 insertions(+), 53 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5f0e1fa..e139a40 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -6,68 +6,75 @@ on:
jobs:
build-deploy:
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v2
- with:
- node-version: 14
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 16
+ registry-url: 'https://registry.npmjs.org'
- - run: npm install
- - run: npm run build
- - run: npm run coverage
- - run: cp -p dist/*html coverage
- - run: cp -p dist/*js coverage
+ - run: npm install
+ - run: npm run build
+ - run: npm run coverage
+ - run: cp -p dist/*html coverage
+ - run: cp -p dist/*js coverage
- - run: npm i coverage-badges-cli markdown-to-html-cli -g
- - run: coverage-badges
- - run: markdown-to-html --output coverage/index.html --favicon 'data:image/svg+xml,'
- - run: markdown-to-html --source README-zh.md --output coverage/index.zh.html --favicon 'data:image/svg+xml,'
+ - run: npm i coverage-badges-cli markdown-to-html-cli -g
+ - run: coverage-badges
+ - run: markdown-to-html --output coverage/index.html --favicon 'data:image/svg+xml,'
+ - run: markdown-to-html --source README-zh.md --output coverage/index.zh.html --favicon 'data:image/svg+xml,'
- - name: Create Tag
- id: create_tag
- uses: jaywcjlove/create-tag-action@v1.3.6
- with:
- package-path: ./package.json
+ - name: Create Tag
+ id: create_tag
+ uses: jaywcjlove/create-tag-action@main
+ with:
+ package-path: ./package.json
- - name: get tag version
- id: tag_version
- uses: jaywcjlove/changelog-generator@v1.5.0
+ - name: get tag version
+ id: tag_version
+ uses: jaywcjlove/changelog-generator@main
- - name: Deploy
- uses: peaceiris/actions-gh-pages@v3
- with:
- commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
- github_token: ${{ secrets.GITHUB_TOKEN }}
- publish_dir: ./coverage
+ - name: Deploy
+ uses: peaceiris/actions-gh-pages@v3
+ with:
+ commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: ./coverage
- - name: Generate Changelog
- id: changelog
- uses: jaywcjlove/changelog-generator@v1.5.0
- with:
- head-ref: ${{steps.create_tag.outputs.version}}
- filter-author: (renovate-bot|Renovate Bot)
- filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
+ - name: Generate Changelog
+ id: changelog
+ uses: jaywcjlove/changelog-generator@main
+ with:
+ head-ref: ${{steps.create_tag.outputs.version}}
+ filter-author: (renovate-bot|Renovate Bot)
+ filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
- - name: Create Release
- uses: ncipollo/release-action@v1
- if: steps.create_tag.outputs.successful
- with:
- name: ${{ steps.create_tag.outputs.version }}
- tag: ${{ steps.create_tag.outputs.version }}
- token: ${{ secrets.GITHUB_TOKEN }}
- body: |
- [![](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/cookiejs@${{steps.changelog.outputs.version}}/file/README.md)
+ - name: Create Release
+ uses: ncipollo/release-action@v1
+ if: steps.create_tag.outputs.successful
+ with:
+ name: ${{ steps.create_tag.outputs.version }}
+ tag: ${{ steps.create_tag.outputs.version }}
+ token: ${{ secrets.GITHUB_TOKEN }}
+ body: |
+ [![](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/cookiejs@${{steps.changelog.outputs.version}}/file/README.md)
- ${{ steps.changelog.outputs.compareurl }}
-
- ${{ steps.changelog.outputs.changelog }}
+ ${{ steps.changelog.outputs.compareurl }}
+
+ ${{ steps.changelog.outputs.changelog }}
- - uses: JS-DevTools/npm-publish@v1
- with:
- token: ${{ secrets.NPM_TOKEN }}
- package: ./package.json
+ - uses: JS-DevTools/npm-publish@v1
+ with:
+ token: ${{ secrets.NPM_TOKEN }}
+ package: ./package.json
- # - run: npm install @jsdevtools/npm-publish -g
- # - run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./package.json
\ No newline at end of file
+ # - run: npm install @jsdevtools/npm-publish -g
+ # - run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./package.json
+
+ - name: 📦 cookiejs publish to NPM
+ run: npm publish
+ continue-on-error: true
+ env:
+ NODE_AUTH_TOKEN: '${{ secrets.NPM_TOKEN }}'
\ No newline at end of file