Skip to content

Commit

Permalink
chore: update workflows config.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Mar 1, 2023
1 parent e82c064 commit 0d36353
Showing 1 changed file with 60 additions and 53 deletions.
113 changes: 60 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🍪</text></svg>'
- run: markdown-to-html --source README-zh.md --output coverage/index.zh.html --favicon 'data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🍪</text></svg>'
- 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,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🍪</text></svg>'
- run: markdown-to-html --source README-zh.md --output coverage/index.zh.html --favicon 'data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🍪</text></svg>'

- 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
# - 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 }}'

0 comments on commit 0d36353

Please sign in to comment.