-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #805 from GenXProject/release/0.4.2
Release v0.4.2
- Loading branch information
Showing
102 changed files
with
2,760 additions
and
764 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,22 @@ | ||
name: Changelog Enforcer | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] | ||
|
||
jobs: | ||
# Enforces update of changelog file on every pull request | ||
Changelog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dangoslen/changelog-enforcer@v3 | ||
with: | ||
changeLogPath: 'CHANGELOG.md' | ||
skipLabels: 'Skip-Changelog, skip changelog' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
missingUpdateErrorMessage: > | ||
No update to CHANGELOG.md found! Please add an entry describing | ||
your change and include the pull request tag. Note that we use | ||
the keepachangelog format (https://keepachangelog.com). If your | ||
change doesn’t require a changelog entry, please add the | ||
'Skip-Changelog' or 'skip changelog' label to the pull request. |
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,137 @@ | ||
name: Dev Version Check and Update | ||
|
||
on: | ||
pull_request_review: | ||
types: [submitted] | ||
|
||
jobs: | ||
check-version: | ||
if: github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'develop' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- name: Set up Julia | ||
uses: julia-actions/setup-julia@latest | ||
with: | ||
version: '1.x' | ||
|
||
- uses: julia-actions/cache@v2 | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "[email protected]" | ||
- name: Check and Update Version | ||
env: | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
REPO: ${{ github.repository }} | ||
run: | | ||
# Get PR base branch and export it | ||
export BASE_BRANCH=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ | ||
"https://api.github.com/repos/$REPO/pulls/$PR_NUMBER" | \ | ||
jq -r .base.ref) | ||
julia -e ' | ||
# Get base branch directly from environment variable | ||
base_branch = ENV["BASE_BRANCH"] | ||
# First ensure we have the base branch | ||
run(`git fetch origin $(base_branch)`) | ||
function parse_version(version_str) | ||
# Extract M.m.p and optional dev number | ||
base_pattern = r"^(\d+\.\d+\.\d+)(?:-dev\.(\d+))?$" | ||
m = match(base_pattern, version_str) | ||
if isnothing(m) | ||
error("Invalid version format: $version_str") | ||
end | ||
version = m.captures[1] | ||
dev_num = isnothing(m.captures[2]) ? nothing : parse(Int, m.captures[2]) | ||
return (version, dev_num) | ||
end | ||
function should_update_version(base_ver_str, current_ver_str) | ||
base_ver, base_dev = parse_version(base_ver_str) | ||
current_ver, current_dev = parse_version(current_ver_str) | ||
# If versions differ, no update needed | ||
if base_ver != current_ver | ||
return false | ||
end | ||
# If base has dev number, we should increment from the base dev number | ||
if !isnothing(base_dev) | ||
return true | ||
end | ||
# If base has no dev number and current has none, add dev.1 | ||
if isnothing(base_dev) && isnothing(current_dev) | ||
return true | ||
end | ||
return false | ||
end | ||
function get_new_version(base_ver_str, current_ver_str) | ||
base_ver, base_dev = parse_version(base_ver_str) | ||
current_ver, current_dev = parse_version(current_ver_str) | ||
# If base has a dev number, increment from that | ||
if !isnothing(base_dev) | ||
return "$(base_ver)-dev.$(base_dev + 1)" | ||
end | ||
# If no dev numbers exist, start with dev.1 | ||
return "$(current_ver)-dev.1" | ||
end | ||
function check_and_update_version() | ||
# Get the base branch version | ||
base_content = read(pipeline(`git show origin/$(base_branch):Project.toml`), String) | ||
# Get current branch version | ||
current_content = read(joinpath(pwd(), "Project.toml"), String) | ||
# Extract versions using regex | ||
version_pattern = r"version = \"(.*?)\"" | ||
base_version = match(version_pattern, base_content).captures[1] | ||
current_version = match(version_pattern, current_content).captures[1] | ||
println("Base version: $base_version") | ||
println("Current version: $current_version") | ||
if should_update_version(base_version, current_version) | ||
println("Version needs updating") | ||
new_version = get_new_version(base_version, current_version) | ||
# Update the file | ||
new_content = replace(current_content, | ||
"version = \"$current_version\"" => | ||
"version = \"$new_version\"") | ||
write(joinpath(pwd(), "Project.toml"), new_content) | ||
# Commit and push the change | ||
run(`git add $(joinpath(pwd(), "Project.toml"))`) | ||
run(`git commit -m "Bump version to $new_version"`) | ||
run(`git push`) | ||
println("Version updated to $new_version") | ||
else | ||
println("Version already updated") | ||
end | ||
end | ||
check_and_update_version()' |
This file was deleted.
Oops, something went wrong.
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
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.
0efaff1
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.
@JuliaRegistrator register
0efaff1
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.
Registration pull request created: JuliaRegistries/General/122481
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: