From e73260238855419d6f8df6cc3ce3af3575999cc6 Mon Sep 17 00:00:00 2001 From: Akrem Abayed Date: Sun, 18 Feb 2024 12:45:12 +0100 Subject: [PATCH] add an action to publish bump versions --- .github/workflows/publish-new-release.yml | 77 ++++++++++++++--------- 1 file changed, 47 insertions(+), 30 deletions(-) diff --git a/.github/workflows/publish-new-release.yml b/.github/workflows/publish-new-release.yml index 3672fc4046..e2ec722ca5 100644 --- a/.github/workflows/publish-new-release.yml +++ b/.github/workflows/publish-new-release.yml @@ -1,37 +1,54 @@ name: Publish a new release on: - workflow_dispatch: - inputs: - bump-type: - description: "Bump Type" - required: true - default: "Minor" - type: choice - options: - - Patch - - Minor - - Major - + workflow_dispatch: + inputs: + bump-type: + description: "Bump Type" + required: true + default: "patch" + type: choice + options: + - Patch + - Minor + - Major jobs: - migrate-db-schema-stage: - name: Bump version - continue-on-error: false - runs-on: ubuntu-latest - environment: stage.cloud + migrate-db-schema-stage: + name: Bump version + continue-on-error: false + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: ${{ github.ref }} + - name: Bump versions + run: | + BUMP_TYPE=${{ inputs.bump-type }} + echo "Bumping versions to $BUMP_TYPE" + cd agenta-web + npm version $BUMP_TYPE + cd .. + cd agenta-cli + poetry version $BUMP_TYPE + cd .. + cd agenta-backend + poetry version $BUMP_TYPE - - name: Bump - run: | - cd agenta-web - npm run patch - cd agenta-cli - poetry version patch - cd agenta-backend - poetry version patch \ No newline at end of file + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.PAT }} \ No newline at end of file