Skip to content

Commit

Permalink
feat: add github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Feb 22, 2021
1 parent 13feff9 commit f13280b
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Npm Publish

on:
push:
branches:
- main

jobs:
publish-npm:
if: "contains(github.event.head_commit.message, '[release]')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: use Node.js 14
uses: actions/setup-node@v1
with:
registry-url: https://registry.npmjs.org/
node-version: 14

- name: npm install and publish
run: |
npm install
npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Create Release

on:
push:
tags:
- v*

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Create Release for Tag
id: release_tag
uses: yyx990803/release-tag@master
env:
GITHUB_TOKEN: ${{ secrets.OPER_TOKEN }}
with:
tag_name: ${{ github.ref }}
body: |
Please refer to [CHANGELOG.md](https://github.com/anncwb/vite-plugin-imagemin/blob/main/CHANGELOG.md) for details.
# - name: npm install and create changeLog
# run: |
# npm install
# npm run log
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## 0.2.7 (2021-02-22)

### Bug Fixes

- fix window path ([f313847](https://github.com/anncwb/vite-plugin-imagemin/commit/f313847f0d6be9f30cb1ab28cef83acd27682794))
- webp default false ([13feff9](https://github.com/anncwb/vite-plugin-imagemin/commit/13feff90ea0310ab64c153762c73f01057ffe3cb))
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dev": "npm run build -- --watch",
"build": "tsup src/index.ts --dts --format cjs,esm",
"prepublishOnly": "yarn build",
"log": "conventional-changelog -p angular -i CHANGELOG.md ",
"log": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"example:dev": "npm -C example run serve",
"example:build": "npm -C example run build"
},
Expand Down

0 comments on commit f13280b

Please sign in to comment.