Skip to content

Commit

Permalink
chore: setup release actions
Browse files Browse the repository at this point in the history
  • Loading branch information
wibus-wee committed Dec 21, 2022
1 parent 9bab349 commit 3072a4a
Show file tree
Hide file tree
Showing 3 changed files with 903 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on:
push:
tags: ['v*']

name: Release

jobs:
release:
name: Create Release
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
# outputs:
# release_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Cache pnpm modules
uses: actions/cache@v3
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- uses: pnpm/[email protected]
with:
version: latest
run_install: true

- name: Test
timeout-minutes: 10
run: |
npm run build:core
- name: Create Release
id: create_release
run: |
npx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to NPM
run: |
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
},
"license": "MIT",
"devDependencies": {
"@innei/bump-version": "^1.5.4",
"@types/minimist": "^1.2.2",
"@types/node": "^18.11.17",
"@types/prompts": "^2.4.2",
Expand All @@ -58,5 +59,15 @@
"*.{js,ts,css,json}": [
"prettier --write"
]
},
"bump": {
"leading": [
"git pull --rebase"
],
"publish": false,
"changelog": true,
"allowed_branches": [
"main"
]
}
}
Loading

0 comments on commit 3072a4a

Please sign in to comment.