|
|
@@ -0,0 +1,108 @@
|
|
|
+name: Release
|
|
|
+
|
|
|
+on:
|
|
|
+ push:
|
|
|
+ tags:
|
|
|
+ - "v*"
|
|
|
+
|
|
|
+permissions:
|
|
|
+ contents: write
|
|
|
+
|
|
|
+jobs:
|
|
|
+ test:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ strategy:
|
|
|
+ matrix:
|
|
|
+ node-version: [20, 22]
|
|
|
+
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v4
|
|
|
+
|
|
|
+ - uses: pnpm/action-setup@v4
|
|
|
+ with:
|
|
|
+ version: 9
|
|
|
+
|
|
|
+ - uses: actions/setup-node@v4
|
|
|
+ with:
|
|
|
+ node-version: ${{ matrix.node-version }}
|
|
|
+ cache: pnpm
|
|
|
+
|
|
|
+ - run: pnpm install --frozen-lockfile
|
|
|
+ - run: pnpm build
|
|
|
+ - run: pnpm --filter @actalk/inkos-core typecheck
|
|
|
+ - run: pnpm --filter @actalk/inkos typecheck
|
|
|
+ - run: pnpm test
|
|
|
+
|
|
|
+ smoke-test:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ needs: test
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v4
|
|
|
+
|
|
|
+ - uses: pnpm/action-setup@v4
|
|
|
+ with:
|
|
|
+ version: 9
|
|
|
+
|
|
|
+ - uses: actions/setup-node@v4
|
|
|
+ with:
|
|
|
+ node-version: 22
|
|
|
+ cache: pnpm
|
|
|
+
|
|
|
+ - run: pnpm install --frozen-lockfile
|
|
|
+ - run: pnpm build
|
|
|
+
|
|
|
+ - name: Smoke test — CLI help and version
|
|
|
+ run: |
|
|
|
+ node packages/cli/dist/index.js --help
|
|
|
+ node packages/cli/dist/index.js --version
|
|
|
+
|
|
|
+ - name: Smoke test — core import
|
|
|
+ run: node -e "import('@actalk/inkos-core').then(m => { if (!m.PipelineRunner) throw new Error('missing PipelineRunner'); console.log('core import OK') })"
|
|
|
+
|
|
|
+ publish:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ needs: smoke-test
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v4
|
|
|
+
|
|
|
+ - uses: pnpm/action-setup@v4
|
|
|
+ with:
|
|
|
+ version: 9
|
|
|
+
|
|
|
+ - uses: actions/setup-node@v4
|
|
|
+ with:
|
|
|
+ node-version: 22
|
|
|
+ cache: pnpm
|
|
|
+ registry-url: https://registry.npmjs.org
|
|
|
+
|
|
|
+ - run: pnpm install --frozen-lockfile
|
|
|
+ - run: pnpm build
|
|
|
+ - run: pnpm -r publish --no-git-checks
|
|
|
+ env:
|
|
|
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
+
|
|
|
+ github-release:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ needs: publish
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v4
|
|
|
+ with:
|
|
|
+ fetch-depth: 0
|
|
|
+
|
|
|
+ - name: Generate release notes
|
|
|
+ id: notes
|
|
|
+ run: |
|
|
|
+ PREV_TAG=$(git tag --sort=-creatordate | sed -n '2p' || echo "")
|
|
|
+ if [ -n "$PREV_TAG" ]; then
|
|
|
+ echo "notes<<EOF" >> "$GITHUB_OUTPUT"
|
|
|
+ git log --pretty=format:"- %s (%h)" "$PREV_TAG"..HEAD >> "$GITHUB_OUTPUT"
|
|
|
+ echo "" >> "$GITHUB_OUTPUT"
|
|
|
+ echo "EOF" >> "$GITHUB_OUTPUT"
|
|
|
+ else
|
|
|
+ echo "notes=Initial release" >> "$GITHUB_OUTPUT"
|
|
|
+ fi
|
|
|
+
|
|
|
+ - uses: softprops/action-gh-release@v2
|
|
|
+ with:
|
|
|
+ body: ${{ steps.notes.outputs.notes }}
|
|
|
+ generate_release_notes: true
|