Kaynağa Gözat

Merge pull request #56 from marcelovicentegc/feat/release-workflow

feat: CLI release workflow
Steve Sewell 1 yıl önce
ebeveyn
işleme
e0fb9d16b5
5 değiştirilmiş dosya ile 7228 ekleme ve 1190 silme
  1. 23 0
      .github/workflows/build.yml
  2. 23 0
      .github/workflows/release.yml
  3. 12 0
      .releaserc
  4. 7166 1190
      package-lock.json
  5. 4 0
      package.json

+ 23 - 0
.github/workflows/build.yml

@@ -0,0 +1,23 @@
+name: Build workflow
+
+on:
+  pull_request:
+    types: [opened, reopened, synchronize]
+
+jobs:
+  build:
+    name: build
+    runs-on: ubuntu-latest
+    env:
+      CI_JOB_NUMBER: 1
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-node@v2
+        with:
+          cache: npm
+          node-version: 18
+      - run: npm i
+      - run: npm run build
+      - uses: preactjs/compressed-size-action@v2
+        with:
+          pattern: ".dist/**/*.{js,ts,json}"

+ 23 - 0
.github/workflows/release.yml

@@ -0,0 +1,23 @@
+name: Release workflow
+
+on:
+  push:
+    branches:
+      - main
+
+jobs:
+  release:
+    name: release
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-node@v2
+        with:
+            cache: npm
+            node-version: 18
+      - run: npm i
+      - run: npm run build
+      - run: npm run semantic-release
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

+ 12 - 0
.releaserc

@@ -0,0 +1,12 @@
+{
+  "branches": [
+    "main"
+  ],
+  "plugins": [
+    "@semantic-release/commit-analyzer",
+    "@semantic-release/changelog",
+    "@semantic-release/npm",
+    "@semantic-release/git",
+    "@semantic-release/github"
+  ]
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 7166 - 1190
package-lock.json


+ 4 - 0
package.json

@@ -18,12 +18,16 @@
   },
   "devDependencies": {
     "@apify/tsconfig": "^0.1.0",
+    "@semantic-release/changelog": "^6.0.3",
+    "@semantic-release/git": "^10.0.1",
     "@types/inquirer": "^9.0.7",
     "@types/node": "^20.0.0",
+    "semantic-release": "^22.0.8",
     "ts-node": "^10.8.0",
     "typescript": "^5.0.0"
   },
   "scripts": {
+    "semantic-release": "semantic-release",
     "preinstall": "npx playwright install",
     "start": "npm run start:dev",
     "start:cli": "cross-env NODE_ENV=development npm run build && node dist/src/cli.js",