From a3906ba1a003fbe5f693903f149cbaa9d8e7cdf4 Mon Sep 17 00:00:00 2001 From: Saurav Panda Date: Tue, 3 Dec 2024 11:53:48 -0800 Subject: [PATCH] added new build process to publish packages --- .github/workflows/update-template.yml | 32 ++++++++++++++++++++++++++- packages/create-app/package.json | 2 +- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-template.yml b/.github/workflows/update-template.yml index e0bbeae..fe3ab34 100644 --- a/.github/workflows/update-template.yml +++ b/.github/workflows/update-template.yml @@ -62,4 +62,34 @@ jobs: token: ${{ steps.generate_token.outputs.token }} repository: ${{ github.repository_owner }}/akiradocs-template event-type: update-template - client-payload: '{"ref": "${{ github.ref }}","sha": "${{ github.sha }}","version": "${{ steps.get-version.outputs.version }}"}' \ No newline at end of file + client-payload: '{"ref": "${{ github.ref }}","sha": "${{ github.sha }}","version": "${{ steps.get-version.outputs.version }}"}' + + publish-npm: + needs: trigger-update + if: needs.trigger-update.outputs.version_changed == 'true' + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + + - name: Install Dependencies + run: npm install + + - name: Build Package + working-directory: packages/create-app + run: npm run build + + - name: Publish to NPM + working-directory: packages/create-app + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 84231e3..818459e 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,6 +1,6 @@ { "name": "create-akiradocs", - "version": "1.0.40", + "version": "1.0.41", "description": "Create Akira Docs documentation sites with one command", "main": "./dist/index.js", "type": "module",