Skip to content

Commit 0ec11a2

Browse files
committed
Setup publish, and some vitest testing.
1 parent 98531a4 commit 0ec11a2

File tree

7 files changed

+11031
-2315
lines changed

7 files changed

+11031
-2315
lines changed

.github/workflows/npm-publish-github-packages.yml

+29-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2-
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3-
4-
name: Package Build
1+
# CI/CD Pipeline for Build, Test, Package, and Publish
2+
name: Build-Test-Package-Publish
53

64
on:
75
push:
@@ -17,8 +15,30 @@ jobs:
1715
with:
1816
node-version: 18
1917
- run: npm ci
20-
- run: npm run build && npm run build-minify
21-
18+
- run: npm run build
19+
20+
test:
21+
needs: build
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v3
25+
- uses: actions/setup-node@v3
26+
with:
27+
node-version: 18
28+
- run: npm ci
29+
- run: npm run test:vitest
30+
31+
package:
32+
needs: test
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v3
36+
- uses: actions/setup-node@v3
37+
with:
38+
node-version: 18
39+
- run: npm ci
40+
- run: npm run build
41+
2242
- name: Upload build artifact
2343
uses: actions/upload-artifact@v3
2444
with:
@@ -27,8 +47,9 @@ jobs:
2747
./dist/servicestack-vue.mjs
2848
./dist/servicestack-vue.min.mjs
2949
./dist/servicestack-vue.umd.cjs
30-
publish-gpr:
31-
needs: build
50+
51+
publish:
52+
needs: package
3253
runs-on: ubuntu-latest
3354
permissions:
3455
contents: read

.github/workflows/publish.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: NPM Publish
2+
3+
# Trigger the workflow manually
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: '18'
15+
- run: npm ci
16+
- run: npm run build && npm run build-minify
17+
18+
- name: Upload build artifact
19+
uses: actions/upload-artifact@v3
20+
with:
21+
name: servicestack-vue
22+
path: |
23+
./dist/servicestack-vue.mjs
24+
./dist/servicestack-vue.min.mjs
25+
./dist/servicestack-vue.umd.cjs
26+
27+
publish-npm:
28+
needs: build
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v3
32+
- uses: actions/setup-node@v3
33+
with:
34+
node-version: '18'
35+
registry-url: 'https://registry.npmjs.org'
36+
- run: npm ci
37+
- run: npm publish
38+
env:
39+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 commit comments

Comments
 (0)