diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index c424141c..77d6dbdf 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -7,9 +7,11 @@ on: permissions: contents: write jobs: - publish: + check: runs-on: ubuntu-latest - environment: Production + outputs: + VERSION_EXISTS: ${{ steps.check-version.outputs.VERSION_EXISTS }} + VERSION: ${{ steps.get-version.outputs.VERSION }} steps: - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - uses: actions/checkout@v4 @@ -40,26 +42,35 @@ jobs: else echo "VERSION_EXISTS=false" >> "$GITHUB_OUTPUT" fi + publish: + runs-on: ubuntu-latest + environment: Production + needs: check + if: needs.check.outputs.VERSION_EXISTS == 'false' + steps: + - uses: GitHubSecurityLab/actions-permissions/monitor@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: package.json + registry-url: "https://registry.npmjs.org" + cache: "npm" - name: Build package - if: steps.check-version.outputs.VERSION_EXISTS == 'false' run: | npm ci npm run build - name: Publish to NPM - if: steps.check-version.outputs.VERSION_EXISTS == 'false' run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish git tag - if: steps.check-version.outputs.VERSION_EXISTS == 'false' run: | git config --global user.name 'github-actions[bot]' git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' - git tag ${{ steps.get-version.outputs.VERSION }} + git tag ${{ needs.check.outputs.VERSION }} git push origin --tags - name: Publish git release - if: steps.check-version.outputs.VERSION_EXISTS == 'false' env: GH_TOKEN: ${{ github.token }} run: | - gh release create ${{ github.env.VERSION }} --title "${{ github.env.VERSION }}" --generate-notes + gh release create ${{ needs.check.outputs.VERSION }} --title "${{ needs.check.outputs.VERSION }}" --generate-notes diff --git a/.github/workflows/version_bump.yaml b/.github/workflows/version_bump.yaml deleted file mode 100644 index f0f4894e..00000000 --- a/.github/workflows/version_bump.yaml +++ /dev/null @@ -1,37 +0,0 @@ ---- -name: Version Bump -on: - workflow_dispatch: - inputs: - version: - description: "Version to bump to" - required: true - default: "patch" -jobs: - bump-version: - runs-on: ubuntu-latest - steps: - - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version-file: package.json - registry-url: "https://registry.npmjs.org" - cache: "npm" - - name: Build package - run: | - npm ci - - name: Bump version - run: | - npm version ${{ github.event.inputs.version }} --no-git-tag-version - - name: Create PR - uses: peter-evans/create-pull-request@v4 - with: - title: "Bump version to ${{ github.event.inputs.version }}" - body: "Bump version to ${{ github.event.inputs.version }}" - base: main - branch: ci/version-bump-${{ github.event.inputs.version }} - commit-message: "Bump version to ${{ github.event.inputs.version }}" - author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" - committer: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" - labels: version-bump diff --git a/package-lock.json b/package-lock.json index 63bb0f13..f5e0be10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mongodb-js/mongodb-mcp-server", - "version": "0.0.2", + "version": "0.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mongodb-js/mongodb-mcp-server", - "version": "0.0.2", + "version": "0.0.3", "license": "Apache-2.0", "dependencies": { "@modelcontextprotocol/sdk": "^1.8.0", diff --git a/package.json b/package.json index e15672aa..bdbeed63 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@mongodb-js/mongodb-mcp-server", "description": "MongoDB Model Context Protocol Server", - "version": "0.0.2", + "version": "0.0.3", "main": "dist/index.js", "author": "MongoDB ", "homepage": "https://github.com/mongodb-js/mongodb-mcp-server",