-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into print-func-for-run-namepsaced-job
- Loading branch information
Showing
14 changed files
with
306 additions
and
197 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Nightly Release Candidate | ||
|
||
permissions: | ||
contents: write | ||
|
||
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: | | ||
git fetch --prune --unshallow | ||
latest_tag=${{ env.latest_tag }} | ||
if git diff --exit-code $latest_tag HEAD -- '*.py' 'requirements.txt'; 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: Generate release notes | ||
id: generate_release_notes | ||
if: env.SHOULD_CREATE_RELEASE == 'true' | ||
uses: mikepenz/release-changelog-builder-action@v2 | ||
with: | ||
tag: ${{ env.next_tag }} | ||
|
||
- name: Create release | ||
id: create_release | ||
if: env.SHOULD_CREATE_RELEASE == 'true' | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.next_tag }} | ||
release_name: "Nightly Release Candidate ${{ env.next_tag }}" | ||
draft: false | ||
prerelease: true | ||
body: ${{ steps.generate_release_notes.outputs.changelog }} |
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
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
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
Oops, something went wrong.