|
| 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 | + id: create-yggdrasil-pr |
| 48 | + run: | |
| 49 | + gh auth login --with-token <<< "${{ secrets.GH_TOKEN }}" |
| 50 | + gh repo clone JuliaPackaging/Yggdrasil |
| 51 | + cd Yggdrasil |
| 52 | + branch_name="update-mmtk-julia-${{ env.commit_hash }}" |
| 53 | + git checkout -b "$branch_name" |
| 54 | + sed -i "10s/hash = \".*\"/hash = \"${{ env.commit_hash }}\"/" M/mmtk_julia/build_tarballs.jl |
| 55 | + git commit -am "Update MMTK Julia hash" |
| 56 | + git push origin "$branch_name" |
| 57 | + pr_url=$(gh pr create --title "Update MMTK Julia hash" --body "Auto-generated PR to update MMTK Julia hash." --base master --head "$branch_name") |
| 58 | + echo "pr_url=$pr_url" >> $GITHUB_ENV |
| 59 | + echo "pr_url=$pr_url" >> $GITHUB_OUTPUT |
| 60 | +
|
| 61 | + update-julia: |
| 62 | + needs: update-yggdrasil |
| 63 | + runs-on: ubuntu-latest |
| 64 | + steps: |
| 65 | + - name: Checkout repository |
| 66 | + uses: actions/checkout@v4 |
| 67 | + |
| 68 | + - name: Get latest commit hash |
| 69 | + id: get-hash |
| 70 | + run: echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_ENV |
| 71 | + |
| 72 | + - name: Get Yggdrasil PR URL |
| 73 | + run: echo "yggdrasil_pr=${{ needs.update-yggdrasil.outputs.pr_url }}" >> $GITHUB_ENV |
| 74 | + |
| 75 | + - name: Open PR to JuliaLang/julia |
| 76 | + run: | |
| 77 | + gh auth login --with-token <<< "${{ secrets.GH_TOKEN }}" |
| 78 | + gh repo clone JuliaLang/julia |
| 79 | + cd julia |
| 80 | + branch_name="update-mmtk-julia-${{ env.commit_hash }}" |
| 81 | + git checkout -b "$branch_name" |
| 82 | + sed -i "s/MMTK_JULIA_SHA1 = \".*\"/MMTK_JULIA_SHA1 = \"${{ env.commit_hash }}\"/" deps/mmtk_julia.version |
| 83 | + sed -i "s/MMTK_JULIA_TAR_URL = \".*\"/MMTK_JULIA_TAR_URL = \"v${{ env.new_version }}.tar.gz\"/" deps/mmtk_julia.version |
| 84 | + git commit -am "Update MMTK Julia references" |
| 85 | + git push origin "$branch_name" |
| 86 | + 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" |
0 commit comments