Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions .github/workflows/_build-wheel-release-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,38 @@ jobs:
commit_message: update changelog
branch: main

delete-create-new-tag:
# For a full release, we delete and create a new tag to reflect the latest changes in the CHANGELOG.rst.
# Recall that during the full release, the `main` branch's CHANGELOG.rst has been updated, and we want the
# tag to reflect the latest changes in the CHANGELOG.rst done by the update-changelog above.
# For more discussions, please read https://github.com/Billingegroup/release-scripts/pull/120
needs: [update-changelog]
# Always run this job for a full release but fail if the update-changelog job previously failed.
if: "always() && !contains(github.ref, 'rc')"
runs-on: ubuntu-latest
steps:
- name: Fail delete-create-new-tag job if CHANGELOG update failed
run: |
if [ "${{ needs.update-changelog.result }}" == 'success' ]; then
echo "Ready to delete and create new tag containing the latest CHANGELOG.rst update in the main branch..."
else
echo "Previous update-changelog job failed; exiting..."
exit 1
fi
- name: Checkout the repository
uses: actions/checkout@v4
with:
ref: main
- name: Delete the tag
run: |
git fetch --tags
git tag -d "${{ github.ref_name }}"
git push origin ":${{ github.ref_name }}"
- name: Create a new tag (Expect commit SHA to match with that of main branch)
run: |
git tag "${{ github.ref_name }}"
git push origin "${{ github.ref_name }}"

github-pre-release:
needs: [build-pure-python-package, build-non-pure-python-package]
if: "always() && contains(github.ref, 'rc')"
Expand All @@ -97,13 +129,13 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

github-release:
needs: [update-changelog]
needs: [delete-create-new-tag]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must have delete-create-new-tag which depends on build-changelog

if: "always() && !contains(github.ref, 'rc')"
runs-on: ubuntu-latest
steps:
- name: Fail github-release job if CHANGELOG update failed
run: |
if [ "${{ needs.update-changelog.result }}" == 'success' ]; then
if [ "${{ needs.delete-create-new-tag.result }}" == 'success' ]; then
echo "Ready to release on GitHub..."
else
echo "Previous update-changelog job failed; exiting..."
Expand Down Expand Up @@ -159,3 +191,11 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/* --verbose

docs:
needs: [github-pre-release, github-release]
if: always()
uses: ./.github/workflows/_publish-docs-on-release.yml
with:
project: ${{ inputs.project }}
c_extension: ${{ inputs.c_extension }}
4 changes: 2 additions & 2 deletions .github/workflows/_publish-docs-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
type: boolean

jobs:
docs:
build-deploy:
defaults:
run:
shell: bash -l {0}
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Check out ${{ inputs.project }}
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetches branches and tags
ref: ${{ github.ref }}

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
Expand Down