Skip to content

Commit

Permalink
feat(ci): use GitHub run_number for post-release versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Elijas authored Sep 25, 2023
1 parent c505c30 commit b78d407
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ jobs:
run: poetry build
- name: Publish package
run: |
# Use the build number to create a pre-release or post-release version identifier
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
BUILD_NUMBER=${{ github.event.inputs.build_number }}
# Use GitHub's run_number as a post-release version identifier
if [[ "${{ github.event_name }}" == "workflow_dispatch" || "${{ github.ref }}" == 'refs/heads/main' ]]; then
POETRY_VERSION=$(poetry version | awk '{print $2}')
NEW_VERSION="${POETRY_VERSION}.post${BUILD_NUMBER}"
NEW_VERSION="${POETRY_VERSION}.post${{ github.run_number }}"
poetry version "${NEW_VERSION}"
fi
poetry build
Expand Down

0 comments on commit b78d407

Please sign in to comment.