-
Notifications
You must be signed in to change notification settings - Fork 421
chore(ci): bump package version after release via pull request #2239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
defe5e7
b36dea7
2ca2f0e
3905a4c
0d53e16
e391610
5347f64
f847b85
c93aeb7
3649b0f
67a35f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ jobs: | |
build: | ||
runs-on: aws-lambda-powertools_ubuntu-latest_4-core | ||
permissions: | ||
contents: write | ||
contents: read | ||
outputs: | ||
RELEASE_VERSION: ${{ steps.release_version.outputs.RELEASE_VERSION }} | ||
env: | ||
|
@@ -79,13 +79,6 @@ jobs: | |
- name: Run all tests, linting and baselines | ||
if: ${{ !inputs.skip_code_quality }} | ||
run: make pr | ||
- name: Git client setup and refresh tip | ||
run: | | ||
git config user.name "Release bot" | ||
git config user.email "[email protected]" | ||
git config pull.rebase true | ||
git config remote.origin.url >&- || git remote add origin https://github.com/"${ORIGIN}" # Git Detached mode (release notes) doesn't have origin | ||
git pull origin "${BRANCH}" | ||
- name: Bump package version | ||
id: versioning | ||
run: poetry version "${RELEASE_VERSION}" | ||
|
@@ -105,16 +98,6 @@ jobs: | |
# and also future-proof for when we switch to protected branch and update via PR | ||
key: ${{ runner.os }}-${{ env.RELEASE_VERSION }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Update version in trunk | ||
if: steps.versioning.outcome == 'success' | ||
run: | | ||
HAS_CHANGE=$(git status --porcelain) | ||
test -z "${HAS_CHANGE}" && echo "Nothing to update" && exit 0 | ||
git add pyproject.toml | ||
git commit -m "bump version to ${RELEASE_VERSION}" --no-verify | ||
git pull origin "${BRANCH}" # prevents concurrent branch update failing push | ||
git push origin HEAD:refs/heads/"${BRANCH}" | ||
|
||
release: | ||
needs: build | ||
environment: release | ||
|
@@ -143,12 +126,6 @@ jobs: | |
# with: | ||
# repository-url: https://test.pypi.org/legacy/ | ||
|
||
changelog: | ||
needs: release | ||
permissions: | ||
contents: write | ||
uses: ./.github/workflows/reusable_publish_changelog.yml | ||
|
||
# NOTE: Watch out for the depth limit of 4 nested workflow_calls. | ||
# publish_layer -> publish_v2_layer -> reusable_deploy_v2_layer_stack -> reusable_update_v2_layer_arn_docs | ||
publish_layer: | ||
|
@@ -163,6 +140,28 @@ jobs: | |
latest_published_version: ${{ needs.build.outputs.RELEASE_VERSION }} | ||
pre_release: ${{ inputs.pre_release }} | ||
|
||
bump_version: | ||
needs: [build, release] | ||
permissions: | ||
contents: write | ||
heitorlessa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
pull-requests: write | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these permissions not conflicting with each other? I think the References: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not in this case :)
heitorlessa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
runs-on: ubuntu-latest | ||
env: | ||
RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }} | ||
steps: | ||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
- name: Bump package version | ||
id: versioning | ||
run: poetry version "${RELEASE_VERSION}" | ||
- name: Create PR | ||
id: create-pr | ||
uses: ./.github/actions/create-pr | ||
with: | ||
files: "pyproject.toml" | ||
temp_branch_prefix: "ci-bump" | ||
pull_request_title: "chore(ci): bump version to ${{ env.RELEASE_VERSION }}" | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
post_release: | ||
needs: [build, release, publish_layer] | ||
permissions: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.