Skip to content
This repository was archived by the owner on Mar 6, 2025. It is now read-only.

Commit adf3e22

Browse files
authored
ci: 'publish' github action
ref: #5 pr: #6
2 parents cdc7bf1 + adbcf80 commit adf3e22

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/main.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "🚀 Publish"
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
name: 🚀 publish
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
14+
# Checkout repository
15+
- name: 📁 Checkout Repository
16+
uses: actions/checkout@v3
17+
18+
# Setup Node.js
19+
- name: 🟢 Setup Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 16.3.0
23+
24+
# Install Pnpm
25+
- name: ⬇️ Install Pnpm
26+
uses: pnpm/[email protected]
27+
with:
28+
run_install: false
29+
30+
- name: 📒 Get pnpm store directory
31+
id: pnpm-cache
32+
run: |
33+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
34+
35+
- name: 💾 Cache pnpm store
36+
uses: actions/cache@v3
37+
with:
38+
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
39+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
40+
restore-keys: |
41+
${{ runner.os }}-pnpm-store-
42+
43+
- name: 📦 Install dependencies
44+
run: pnpm i --frozen-lockfile
45+
46+
- name: 🔨 Build
47+
run: pnpm build
48+
49+
- name: 🚀 Publish
50+
run: npm publish
51+
env:
52+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)