Skip to content

Release Production (SDK) #1

Release Production (SDK)

Release Production (SDK) #1

name: Release Production (SDK)
on:
workflow_dispatch:
inputs:
version_type:
description: 'Version bump type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
permissions:
contents: write
jobs:
# First job: Prepare production release
prepare-and-commit-prod:
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.bump_version.outputs.new_version }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/setup-project
- name: Calculate and update production version
id: bump_version
run: |
cd sdk
# Get current version and bump it
CURRENT_VERSION=$(bun -e "console.log(require('./package.json').version)")
echo "Current version: $CURRENT_VERSION"
# Bump version based on input
npm version ${{ inputs.version_type }} --no-git-tag-version
NEW_VERSION=$(bun -e "console.log(require('./package.json').version)")
echo "New production version: $NEW_VERSION"
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
- name: Configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Commit and push version bump
run: |
git stash
git pull --rebase origin main
git stash pop
git add sdk/package.json
git commit -m "Bump SDK version to ${{ steps.bump_version.outputs.new_version }}"
git push
- name: Create and push production tag
run: |
git tag "sdk-v${{ steps.bump_version.outputs.new_version }}"
git push origin "sdk-v${{ steps.bump_version.outputs.new_version }}"
- name: Upload updated package
uses: actions/upload-artifact@v4
with:
name: updated-sdk-package
path: sdk/
build-and-publish-sdk:

Check failure on line 73 in .github/workflows/sdk-release-prod.yml

View workflow run for this annotation

GitHub Actions / Release Production (SDK)

Invalid workflow file

The workflow is not valid. .github/workflows/sdk-release-prod.yml (Line: 73, Col: 3): Error calling workflow 'CodebuffAI/codebuff/.github/workflows/sdk-release-build.yml@1460b910a963d2709a02c3a27f3ea9afbd2c0b95'. The nested job 'build-and-publish' is requesting 'id-token: write', but is only allowed 'id-token: none'.
needs: prepare-and-commit-prod
uses: ./.github/workflows/sdk-release-build.yml
with:
new-version: ${{ needs.prepare-and-commit-prod.outputs.new_version }}
artifact-name: updated-sdk-package
checkout-ref: ${{ github.sha }}
secrets: inherit