Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
auto version bump after github release (#1988)
Shuchang Zhenga98e7781c05b
diff --git a/.github/workflows/sdk-release.yml b/.github/workflows/sdk-release.ymlindex cf6cee0a1..266353720 100644--- a/.github/workflows/sdk-release.yml+++ b/.github/workflows/sdk-release.yml@@ -2,16 +2,49 @@ name: Build Skyvern SDK and publish to PyPIon:workflow_dispatch:- release:- types: [ published ]+ push:+ branches:+ - main+ paths:+ - 'pyproject.toml'jobs:+ check-version-change:+ runs-on: ubuntu-latest+ outputs:+ version_changed: ${{ steps.check.outputs.version_changed }}+ steps:+ - uses: actions/checkout@v4+ with:+ fetch-depth: 2++ - name: Check if version changed+ id: check+ run: |+ # Get version from current pyproject.toml+ CURRENT_VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')++ # Get version from previous commit+ git checkout HEAD^1+ PREVIOUS_VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')++ if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then+ echo "Version changed from $PREVIOUS_VERSION to $CURRENT_VERSION"+ echo "version_changed=true" >> $GITHUB_OUTPUT+ else+ echo "Version remained at $CURRENT_VERSION"+ echo "version_changed=false" >> $GITHUB_OUTPUT+ fi+run-ci:+ needs: check-version-change+ if: needs.check-version-change.outputs.version_changed == 'true'uses: ./.github/workflows/ci.ymlbuild-sdk:runs-on: ubuntu-latest- needs: [ run-ci ]+ needs: [check-version-change, run-ci]+ if: needs.check-version-change.outputs.version_changed == 'true'steps:- name: Check out Git repositoryuses: actions/checkout@v4diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.ymlnew file mode 100644index 000000000..b4377815e--- /dev/null+++ b/.github/workflows/version-bump.yml@@ -0,0 +1,41 @@+name: Version Bump on Release++on:+ release:+ types: [published]++jobs:+ update-version:+ runs-on: ubuntu-latest+ permissions:+ contents: write+ pull-requests: write+ steps:+ - uses: actions/checkout@v4++ - name: Extract version from release+ id: get_version+ run: |+ VERSION=${GITHUB_REF#refs/tags/v}+ echo "version=$VERSION" >> $GITHUB_OUTPUT++ - name: Update version in pyproject.toml+ run: |+ sed -i "s/version = \".*\"/version = \"${{ steps.get_version.outputs.version }}\"/" pyproject.toml++ - name: Create Pull Request+ id: create-pr+ uses: peter-evans/create-pull-request@v6+ with:+ commit-message: "chore: bump version to ${{ steps.get_version.outputs.version }}"+ title: "chore: bump version to ${{ steps.get_version.outputs.version }}"+ body: "Auto-generated PR to update version in pyproject.toml"+ branch: "version-bump/${{ steps.get_version.outputs.version }}"+ delete-branch: true++ - name: Enable Pull Request Automerge+ if: steps.create-pr.outputs.pull-request-number+ run: |+ gh pr merge --auto --merge "${{ steps.create-pr.outputs.pull-request-number }}"+ env:+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\ No newline at end of file