Skip to content

Commit

Permalink
Setup publish, and some vitest testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Layoric committed Oct 9, 2023
1 parent 98531a4 commit 0ec11a2
Show file tree
Hide file tree
Showing 7 changed files with 11,031 additions and 2,315 deletions.
37 changes: 29 additions & 8 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Package Build
# CI/CD Pipeline for Build, Test, Package, and Publish
name: Build-Test-Package-Publish

on:
push:
Expand All @@ -17,8 +15,30 @@ jobs:
with:
node-version: 18
- run: npm ci
- run: npm run build && npm run build-minify

- run: npm run build

test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm run test:vitest

package:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm run build

- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
Expand All @@ -27,8 +47,9 @@ jobs:
./dist/servicestack-vue.mjs
./dist/servicestack-vue.min.mjs
./dist/servicestack-vue.umd.cjs
publish-gpr:
needs: build
publish:
needs: package
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: NPM Publish

# Trigger the workflow manually
on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm ci
- run: npm run build && npm run build-minify

- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: servicestack-vue
path: |
./dist/servicestack-vue.mjs
./dist/servicestack-vue.min.mjs
./dist/servicestack-vue.umd.cjs
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
Loading

0 comments on commit 0ec11a2

Please sign in to comment.