Skip to content

Commit

Permalink
chore: add auto-publish workflow (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
kagol authored Mar 8, 2023
1 parent 0b19cd4 commit 578894a
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
changelog:
exclude:
labels:
- ignore-for-release
authors:
- allcontributors[bot]
categories:
- title: Breaking Changes 🛠
labels:
- Semver-Major
- breaking-change
- title: Exciting New Features 🎉
labels:
- Semver-Minor
- feature
- enhancement
- title: Bug Fixes 🐛
labels:
- Semver-Patch
- bug
- title: Other Changes
labels:
- documentation
- refactoring
- unit-test
42 changes: 42 additions & 0 deletions .github/workflows/auto-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Auto publish

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: CheckOut Code
uses: actions/checkout@master

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'

- name: Get package version
uses: tyankatsu0105/read-package-version-actions@v1
id: package-version

- name: Run Build Scripts
run: |
npm i --legacy-peer-deps
npm run build
npm run release
- name: Publish
run: npm publish opentiny-vue-theme-${{ steps.package-version.outputs.version }}.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.package-version.outputs.version }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
"resolutions": {
"graceful-fs": "4.2.2"
},
"overrides": {
"graceful-fs": "^4.2.10"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
Expand Down

0 comments on commit 578894a

Please sign in to comment.