diff --git a/.github/workflows/publish-sdk.yaml b/.github/workflows/publish-sdk.yaml index bc27b0d..a56b028 100644 --- a/.github/workflows/publish-sdk.yaml +++ b/.github/workflows/publish-sdk.yaml @@ -1,13 +1,13 @@ # This workflow is used to publish the Python SDK to the actual PyPI. # It is triggered by a tag push, and will only publish if the tag is valid. -# The tag must match the format sdk-v*.*.* +# The tag must match the format v*.*.* name: Publish Python SDK on: push: tags: - - "sdk-v*.*.*" # Trigger on version tags like sdk-v0.1.0 etc. + - "v*.*.*" # Trigger on version tags like v0.1.0 etc. jobs: validate: diff --git a/.github/workflows/release-tag.yaml b/.github/workflows/release-tag.yaml deleted file mode 100644 index ae495c3..0000000 --- a/.github/workflows/release-tag.yaml +++ /dev/null @@ -1,78 +0,0 @@ -# This workflow creates and pushes a release tag using the push-release-tag.sh script. -# It can be triggered manually and will prompt for confirmation before creating the tag. - -name: Create Release Tag - -on: - workflow_dispatch: - inputs: - dry_run: - description: "Run in dry-run mode (show what would be done without actually creating/pushing the tag)" - required: false - type: boolean - default: true - confirm_release: - description: "Type 'YES' to confirm you want to create and push the release tag" - required: true - type: string - -jobs: - check-branch: - runs-on: ubuntu-latest - environment: production - steps: - - name: Check if running on release branch - run: | - if [ "${{ github.ref }}" != "refs/heads/release" ]; then - echo "Error: This workflow can only be run from the 'release' branch." - echo "Current branch: ${{ github.ref }}" - echo "Please switch to the 'release' branch and try again." - exit 1 - fi - echo "Running on release branch - proceeding with workflow." - - create-release-tag: - runs-on: ubuntu-latest - needs: check-branch - environment: production - if: github.ref == 'refs/heads/release' - - permissions: - contents: write # Required to create and push tags - - steps: - - name: Validate confirmation - if: github.event.inputs.confirm_release != 'YES' && github.event.inputs.dry_run != 'true' - run: | - echo "Error: You must type 'YES' in the confirm_release input to proceed with creating a release tag." - echo "Received: '${{ github.event.inputs.confirm_release }}'" - exit 1 - - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history and tags - - - name: Make scripts executable - run: | - chmod +x scripts/push-release-tag.sh - chmod +x scripts/get_version.sh - - - 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: Run push-release-tag script (dry-run) - if: github.event.inputs.dry_run == 'true' - run: | - echo "Running in dry-run mode..." - make push-release-tag DRY_RUN=--dry-run - - - name: Run push-release-tag script - if: github.event.inputs.dry_run != 'true' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - echo "Creating and pushing release tag..." - # Override the interactive confirmation since we already confirmed via workflow input - echo "YES" | make push-release-tag diff --git a/scripts/validate-release-tag.sh b/scripts/validate-release-tag.sh index 175464e..9b26dd5 100755 --- a/scripts/validate-release-tag.sh +++ b/scripts/validate-release-tag.sh @@ -1,6 +1,6 @@ #!/bin/bash # Validate release requirements -# - Checks if the tag matches naming convention (sdk-v*.*.*) +# - Checks if the tag matches naming convention (v*.*.*) # - Checks if the tag matches the version in the package # - Ensures we're releasing from the release branch @@ -20,14 +20,14 @@ git fetch --tags --prune --force TAG=$1 -# Check if tag starts with sdk-v -if [[ ! "$TAG" =~ ^sdk-v ]]; then - echo "ERROR: Tag must start with 'sdk-v'" +# Check if tag starts with v +if [[ ! "$TAG" =~ ^v ]]; then + echo "ERROR: Tag must start with 'v'" exit 1 fi -# Extract version without the 'sdk-v' prefix -VERSION=${TAG#sdk-v} +# Extract version without the 'v' prefix +VERSION=${TAG#v} PACKAGE_VERSION=$(bash "$ROOT_DIR/scripts/get_version.sh")