diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml index 82772a01..53ac5e35 100644 --- a/.github/workflows/dev-release.yml +++ b/.github/workflows/dev-release.yml @@ -60,5 +60,6 @@ jobs: needs: prepare-dev uses: ./.github/workflows/manual-npm-publish.yml with: + version: ${{ needs.prepare-dev.outputs.version }} dist_tag: dev secrets: inherit diff --git a/.github/workflows/manual-npm-publish.yml b/.github/workflows/manual-npm-publish.yml index d67647ca..86b8768a 100644 --- a/.github/workflows/manual-npm-publish.yml +++ b/.github/workflows/manual-npm-publish.yml @@ -3,6 +3,10 @@ name: Manual NPM Publish on: workflow_dispatch: inputs: + version: + description: "Version to publish (e.g. 0.2.0-dev)" + required: false + type: string dist_tag: description: "npm dist-tag" required: false @@ -10,6 +14,9 @@ on: type: string workflow_call: inputs: + version: + required: true + type: string dist_tag: required: false type: string @@ -47,11 +54,18 @@ jobs: run: npm run build --workspace @neuralnomads/codenomad - name: Set publish metadata + shell: bash run: | - VERSION=$(node -p "require('./package.json').version") - echo "VERSION=$VERSION" >> "$GITHUB_ENV" + VERSION_INPUT="${{ inputs.version }}" + if [ -z "$VERSION_INPUT" ]; then + VERSION_INPUT=$(node -p "require('./package.json').version") + fi + echo "VERSION=$VERSION_INPUT" >> "$GITHUB_ENV" echo "DIST_TAG=${{ inputs.dist_tag || 'dev' }}" >> "$GITHUB_ENV" + - name: Bump package version for publish + run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version + - name: Publish server package with provenance env: NPM_CONFIG_PROVENANCE: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56839fce..20da38b0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,5 +77,6 @@ jobs: needs: prepare-release uses: ./.github/workflows/manual-npm-publish.yml with: + version: ${{ needs.prepare-release.outputs.version }} dist_tag: latest secrets: inherit