Skip to content

Commit 33f5b87

Browse files
committed
Adding workflow to update binary builder and Julia version
1 parent c9e046b commit 33f5b87

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Release and Update Dependencies
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Get latest tag
16+
id: get-latest-tag
17+
run: |
18+
latest_tag=$(git describe --tags --abbrev=0 || echo "v0.1.0")
19+
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
20+
21+
- name: Increment version
22+
id: bump-version
23+
run: |
24+
IFS='.' read -ra parts <<< "${{ env.latest_tag }}"
25+
new_patch=$(( ${parts[2]} + 1 ))
26+
new_version="v${parts[0]}.${parts[1]}.$new_patch"
27+
echo "new_version=$new_version" >> $GITHUB_ENV
28+
29+
- name: Create new GitHub release
30+
uses: softprops/action-gh-release@v1
31+
with:
32+
tag_name: ${{ env.new_version }}
33+
generate_release_notes: true
34+
35+
update-yggdrasil:
36+
needs: release
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v4
41+
42+
- name: Get latest commit hash
43+
id: get-hash
44+
run: echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_ENV
45+
46+
- name: Open PR to Yggdrasil
47+
run: |
48+
gh auth login --with-token <<< "${{ secrets.GH_TOKEN }}"
49+
gh repo clone JuliaPackaging/Yggdrasil
50+
cd Yggdrasil
51+
branch_name="update-mmtk-julia-${{ env.commit_hash }}"
52+
git checkout -b "$branch_name"
53+
sed -i "s/hash = \".*\"/hash = \"${{ env.commit_hash }}\"/" Yggdrasil/M/mmtk_julia/build_tarballs.jl
54+
git commit -am "Update MMTK Julia hash"
55+
git push origin "$branch_name"
56+
gh pr create --title "Update MMTK Julia hash" --body "Auto-generated PR to update MMTK Julia hash." --base master --head "$branch_name"
57+
58+
update-julia:
59+
needs: release
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@v4
64+
65+
- name: Get latest commit hash
66+
id: get-hash
67+
run: echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_ENV
68+
69+
- name: Open PR to JuliaLang/julia
70+
run: |
71+
gh auth login --with-token <<< "${{ secrets.GH_TOKEN }}"
72+
gh repo clone JuliaLang/julia
73+
cd julia
74+
branch_name="update-mmtk-julia-${{ env.commit_hash }}"
75+
git checkout -b "$branch_name"
76+
sed -i "s/MMTK_JULIA_SHA1 = \".*\"/MMTK_JULIA_SHA1 = \"${{ env.commit_hash }}\"/" path/to/julia/file
77+
sed -i "s/MMTK_JULIA_TAR_URL = \".*\"/MMTK_JULIA_TAR_URL = \"v${{ env.new_version }}.tar.gz\"/" path/to/julia/file
78+
git commit -am "Update MMTK Julia references"
79+
git push origin "$branch_name"
80+
gh pr create --title "Update MMTK Julia references" --body "TODO: update the MMTK_JULIA_JLL_VER after the BinaryBuilder PR gets merged." --base master --head "$branch_name"

0 commit comments

Comments
 (0)