Skip to content

Commit

Permalink
chore: update .github/workflows/ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 30, 2021
1 parent f285247 commit 375c8f1
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 13 deletions.
55 changes: 48 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: image2uri test
name: Build & Test
on:
push:
branches:
Expand All @@ -7,13 +7,54 @@ jobs:
build-deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master

- name: Setup Node
uses: actions/setup-node@v1
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
registry-url: https://registry.npmjs.org/
node-version: 14

- run: npm install
- run: npm run coverage

- run: npm i coverage-badges-cli markdown-to-html-cli -g
- run: coverage-badges
- run: markdown-to-html --output coverage/doc.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: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./coverage

- name: Create Tag
id: create_tag
uses: jaywcjlove/create-tag-action@v1.2.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
package-path: ./package.json

- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@v1.4.6
with:
token: ${{ secrets.GITHUB_TOKEN }}
head-ref: ${{steps.create_tag.outputs.version}}
filter-author: (小弟调调™|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/image2uri@${{steps.changelog.outputs.version}}/file/README.md)
${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
- run: npm install @jsdevtools/npm-publish -g
- run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./package.json

8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"name": "image2uri",
"version": "1.0.4",
"description": "Convert image file to data URI.",
"license": "MIT",
"author": "Kenny <wowohoo@qq.com>",
"main": "lib/index.js",
"scripts": {
"prepare": "npm run build",
"start": "node lib/index.js",
"watch": "tsbb watch --disable-babel",
"build": "tsbb build --disable-babel",
"test": "tsbb test",
Expand All @@ -28,11 +29,6 @@
"image-to-uri",
"image2uri"
],
"license": "MIT",
"author": "Kenny <wowohoo@qq.com>",
"dependencies": {
"@babel/runtime": "7.11.2"
},
"devDependencies": {
"tsbb": "3.3.7"
}
Expand Down

0 comments on commit 375c8f1

Please sign in to comment.