-
Notifications
You must be signed in to change notification settings - Fork 10
Adding workflow to update binary builder and Julia version #230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Release and Update Dependencies | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get latest tag | ||
id: get-latest-tag | ||
run: | | ||
latest_tag=$(git describe --tags --abbrev=0 || echo "v0.1.0") | ||
echo "latest_tag=$latest_tag" >> $GITHUB_ENV | ||
|
||
- name: Increment version | ||
id: bump-version | ||
run: | | ||
IFS='.' read -ra parts <<< "${{ env.latest_tag }}" | ||
new_patch=$(( ${parts[2]} + 1 )) | ||
new_version="v${parts[0]}.${parts[1]}.$new_patch" | ||
echo "new_version=$new_version" >> $GITHUB_ENV | ||
|
||
- name: Create new GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ env.new_version }} | ||
generate_release_notes: true | ||
|
||
update-yggdrasil: | ||
needs: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get latest commit hash | ||
id: get-hash | ||
run: echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
|
||
- name: Open PR to Yggdrasil | ||
id: create-yggdrasil-pr | ||
run: | | ||
gh auth login --with-token <<< "${{ secrets.GH_TOKEN }}" | ||
gh repo clone JuliaPackaging/Yggdrasil | ||
cd Yggdrasil | ||
branch_name="update-mmtk-julia-${{ env.commit_hash }}" | ||
git checkout -b "$branch_name" | ||
sed -i "10s/hash = \".*\"/hash = \"${{ env.commit_hash }}\"/" M/mmtk_julia/build_tarballs.jl | ||
git commit -am "Update MMTK Julia hash" | ||
git push origin "$branch_name" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This creates a branch in Alternatively, we can use the mmtk bot account, and push to its own fork of |
||
pr_url=$(gh pr create --title "Update MMTK Julia hash" --body "Auto-generated PR to update MMTK Julia hash." --base master --head "$branch_name") | ||
echo "pr_url=$pr_url" >> $GITHUB_ENV | ||
echo "pr_url=$pr_url" >> $GITHUB_OUTPUT | ||
|
||
update-julia: | ||
needs: update-yggdrasil | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get latest commit hash | ||
id: get-hash | ||
run: echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
|
||
- name: Get Yggdrasil PR URL | ||
run: echo "yggdrasil_pr=${{ needs.update-yggdrasil.outputs.pr_url }}" >> $GITHUB_ENV | ||
|
||
- name: Open PR to JuliaLang/julia | ||
run: | | ||
gh auth login --with-token <<< "${{ secrets.GH_TOKEN }}" | ||
gh repo clone JuliaLang/julia | ||
cd julia | ||
branch_name="update-mmtk-julia-${{ env.commit_hash }}" | ||
git checkout -b "$branch_name" | ||
sed -i "s/MMTK_JULIA_SHA1 = \".*\"/MMTK_JULIA_SHA1 = \"${{ env.commit_hash }}\"/" deps/mmtk_julia.version | ||
sed -i "s/MMTK_JULIA_TAR_URL = \".*\"/MMTK_JULIA_TAR_URL = \"v${{ env.new_version }}.tar.gz\"/" deps/mmtk_julia.version | ||
git commit -am "Update MMTK Julia references" | ||
git push origin "$branch_name" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. This push to a branch in |
||
gh pr create --title "Update MMTK Julia references" --body "TODO: update the MMTK_JULIA_JLL_VER after the [BinaryBuilder PR](${{ env.yggdrasil_pr }}) gets merged." --base master --head "$branch_name" |
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.
This only bumps the point version. I think we can do a release manually, and trigger a workflow when we have a new release. See how we publish mmtk-core to
crates.io
when we tag a release: https://github.com/mmtk/mmtk-core/blob/4ca8812607bfb0b398278e01cbd3755959c7d010/.github/workflows/cargo-publish.yml#L6