From 31bd2fe31b81197e531f71f39baef7edca98a2bc Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Fri, 21 Jul 2023 21:53:57 -0400 Subject: [PATCH] chore(ci): better release flow (#131) --- .github/workflows/create-releases.yml | 41 ++++++++++++++++++++++++++- .github/workflows/release-notes.yml | 37 ------------------------ 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml index ad8b97d8..766aa255 100644 --- a/.github/workflows/create-releases.yml +++ b/.github/workflows/create-releases.yml @@ -91,7 +91,7 @@ jobs: path: dist - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - prepare-for-dev-cycle: + release-notes: needs: - release - publish-python @@ -100,3 +100,42 @@ jobs: uses: bentoml/OpenLLM/.github/workflows/release-notes.yml@main with: tags: ${{ needs.release.outputs.version }} + prepare-next-dev-cycle: + needs: + - binary-distribution + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup python + uses: actions/setup-python@v4 + - name: Install dependencies + run: pip install hatch towncrier + - name: Install jq and curl + run: sudo apt-get install -y jq curl + - name: Import bot's GPG key for signing commits + id: import-gpg-key + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + git_config_global: true + git_user_signingkey: true + git_commit_gpgsign: true + git_tag_gpgsign: true + - name: Bump version to dev + env: + GIT_AUTHOR_NAME: ${{ steps.import-gpg-key.outputs.name }} + GIT_AUTHOR_EMAIL: ${{ steps.import-gpg-key.outputs.email }} + GIT_COMMITTER_NAME: ${{ steps.import-gpg-key.outputs.name }} + GIT_COMMITTER_EMAIL: ${{ steps.import-gpg-key.outputs.email }} + run: | + git pull --autostash --no-edit --gpg-sign --ff origin main + echo "Bumping version to dev..." && hatch version patch && hatch version dev + jq --arg release_version "$(hatch version)" '.version = $release_version' < package.json > package.json.tmp && mv package.json.tmp package.json + git add src/openllm/__about__.py package.json && git commit -S -sm "infra: bump to dev version of $(hatch version) [generated] [skip ci]" + git push origin HEAD:main diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml index 38169b24..7db059fe 100644 --- a/.github/workflows/release-notes.yml +++ b/.github/workflows/release-notes.yml @@ -75,40 +75,3 @@ jobs: dist/* archives/* installers/* - bump-dev: - needs: [gen-release-notes] - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Setup python - uses: actions/setup-python@v4 - - name: Install dependencies - run: pip install hatch towncrier - - name: Install jq and curl - run: sudo apt-get install -y jq curl - - name: Import bot's GPG key for signing commits - id: import-gpg-key - uses: crazy-max/ghaction-import-gpg@v5 - with: - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.GPG_PASSPHRASE }} - git_config_global: true - git_user_signingkey: true - git_commit_gpgsign: true - git_tag_gpgsign: true - - name: Bump version to dev - env: - GIT_AUTHOR_NAME: ${{ steps.import-gpg-key.outputs.name }} - GIT_AUTHOR_EMAIL: ${{ steps.import-gpg-key.outputs.email }} - GIT_COMMITTER_NAME: ${{ steps.import-gpg-key.outputs.name }} - GIT_COMMITTER_EMAIL: ${{ steps.import-gpg-key.outputs.email }} - run: | - git pull --autostash --no-edit --gpg-sign --ff origin main - echo "Bumping version to dev..." && hatch version patch && hatch version dev - jq --arg release_version "$(hatch version)" '.version = $release_version' < package.json > package.json.tmp && mv package.json.tmp package.json - git add src/openllm/__about__.py package.json && git commit -S -sm "infra: bump to dev version of $(hatch version) [generated] [skip ci]" - git push origin HEAD:main