Nightly Development Release #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly Release Candidate | |
on: | |
schedule: | |
- cron: '0 8 * * *' # Run at midnight PST (08:00 UTC) | |
workflow_dispatch: | |
jobs: | |
nightly-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Get latest tag | |
id: get_latest_tag | |
run: | | |
latest_tag=$(git tag -l | grep -E '^3\.[0-9]+\.[0-9]+(rc[0-9]+)?$' | sort -V | tail -n 1) | |
if [ -z "$latest_tag" ]; then | |
echo "No matching tags found." | |
exit 1 | |
fi | |
echo "latest_tag=$latest_tag" >> $GITHUB_ENV | |
- name: Check for changes since latest tag | |
id: check_changes | |
run: | | |
latest_tag=${{ env.latest_tag }} | |
if git diff --exit-code $latest_tag HEAD -- '*.py' setup.py requirements.txt requirements-client.txt ui; then | |
echo "SHOULD_CREATE_RELEASE=false" >> $GITHUB_ENV | |
echo "No changes in .py files or dependencies since the latest tag." | |
else | |
echo "SHOULD_CREATE_RELEASE=true" >> $GITHUB_ENV | |
echo "Changes detected since the latest tag." | |
fi | |
- name: Determine next release candidate | |
id: next_rc | |
if: env.SHOULD_CREATE_RELEASE == 'true' | |
run: | | |
latest_tag=${{ env.latest_tag }} | |
base_version=$(echo $latest_tag | sed -E 's/(.*rc)[0-9]+/\1/') | |
rc_number=$(echo $latest_tag | sed -E 's/.*rc([0-9]+)/\1/') | |
next_rc_number=$((rc_number + 1)) | |
next_tag="${base_version}${next_rc_number}" | |
echo "next_tag=$next_tag" >> $GITHUB_ENV | |
echo "Next tag is $next_tag" | |
- name: Create release | |
id: create_release | |
if: env.SHOULD_CREATE_RELEASE == 'true' | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: "Nightly Release Candidate ${{ env.next_tag }}" | |
tag_name: ${{ env.next_tag }} | |
draft: false | |
prerelease: true | |
generate_release_notes: true | |
token: ${{ secrets.PREFECT_CONTENTS_PR_RW }} |