Parcourir la source

ci: create global build & artifacts

Sven il y a 1 an
Parent
commit
b3a830756f
3 fichiers modifiés avec 13 ajouts et 5 suppressions
  1. 0 0
      .github/workflows/lint-and-analyze.yml
  2. 12 4
      .github/workflows/publish.yml
  3. 1 1
      package.json

+ 0 - 0
.github/workflows/lint.yml → .github/workflows/lint-and-analyze.yml


+ 12 - 4
.github/workflows/publish.yml

@@ -5,6 +5,10 @@ on:
     branches:
       - main
 
+env:
+  PR_TITLE: "Create Release"
+  COMMIT_MSG: "chore: create new release"
+
 concurrency: ${{ github.workflow }}-${{ github.ref }}
 
 jobs:
@@ -13,9 +17,6 @@ jobs:
     strategy:
       matrix:
         node-version: [18.x]
-    env:
-      PR_TITLE: "Create Release"
-      COMMIT_MSG: "chore: create new release"
     steps:
       - uses: actions/checkout@v3
       - uses: actions/setup-node@v3
@@ -24,7 +25,14 @@ jobs:
       - name: Install dependencies
         run: npm ci
       - name: Build package
-        run: npm run build
+        run: |
+          npm run build
+          npm run build-global
+      - name: Create dist folder artifact
+        uses: actions/upload-artifact@v3
+        with:
+          name: dist
+          path: dist/
       - name: Create Release
         uses: changesets/action@v1
         id: changesets

+ 1 - 1
package.json

@@ -9,7 +9,7 @@
     "lint": "tsc --noEmit && eslint .",
     "build-types": "tsc --emitDeclarationOnly --declaration --outDir dist",
     "build-common": "tsup lib/index.ts --format cjs,esm --clean --treeshake",
-    "build-global": "tsup lib/index.ts --format cjs,esm,iife --clean --treeshake --onSuccess \"npm run post-build-global\"",
+    "build-global": "tsup lib/index.ts --format cjs,esm,iife --treeshake --onSuccess \"npm run post-build-global\"",
     "build": "npm run build-common -- --minify && npm run build-types",
     "post-build-global": "npm run node-ts -- ./tools/post-build-global.mts",
     "dev": "npm run build-common -- --sourcemap --watch --onSuccess \"npm run build-types\"",