diff --git a/.github/scripts/update_versions.py b/.github/scripts/update_versions.py index 843e80a3a6..48f312b561 100644 --- a/.github/scripts/update_versions.py +++ b/.github/scripts/update_versions.py @@ -39,14 +39,17 @@ def create_pr(): branch=branch_name, ) - pr = repo.create_pull(title="Update latest-versions.json", - body="Automated PR to update the latest-versions.json file.", - head=branch_name, base="dev") + try: + pr = repo.create_pull(title="Update latest-versions.json", + body="Automated PR to update the latest-versions.json file.", + head=branch_name, base="dev") + except Exception as e: + print(f"Error while creating PR: {e}") pr.create_review_request(reviewers=["ebicoglu", "gizemmutukurt", "skoc10"]) -if __name__ == "__dev__": +if __name__ == "__main__": should_create_pr = update_latest_versions() if should_create_pr: create_pr() - + diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 0000000000..b929fa6d3c --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,44 @@ +name: Create Release + +on: + workflow_dispatch: + inputs: + tag_name: + description: 'Tag Name' + required: true + prerelease: + description: 'Pre-release?' + required: true + branchName: + description: 'Branch Name' + required: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: ${{ github.event.inputs.branchName }} + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + with: + tag_name: ${{ github.event.inputs.tag_name }} + release_name: ${{ github.event.inputs.tag_name }} + draft: false + prerelease: ${{ github.event.inputs.prerelease }} + + - name: Checkout code at tag + uses: actions/checkout@v2 + with: + ref: ${{ github.event.inputs.tag_name }} + + - name: Build Project + run: | + # add your build commands here, depending on your project's requirements. + echo "Build project here" diff --git a/.github/workflows/update-versions.yml b/.github/workflows/update-versions.yml index 386b6858b9..d0a295884f 100644 --- a/.github/workflows/update-versions.yml +++ b/.github/workflows/update-versions.yml @@ -28,6 +28,6 @@ jobs: - name: Update latest-versions.json and create PR env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} run: | python .github/scripts/update_versions.py