From 81b785c5e04e9d46a5beeab371519193d6f3c757 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 21 May 2026 14:32:39 +0900 Subject: [PATCH 1/3] Use ruby/ruby's make-snapshot composite action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop the inlined apt setup, ruby/ruby clone, fetch, and tool/make-snapshot invocation; call ruby/ruby/.github/actions/make- snapshot@master instead. Pass upload-artifact: false so that the matrix entries do not collide on the shared "Packages" artifact name—the S3 step is the only consumer of the produced tarball here. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/upload-tarball.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/upload-tarball.yml b/.github/workflows/upload-tarball.yml index adb49f0..17f7d2b 100644 --- a/.github/workflows/upload-tarball.yml +++ b/.github/workflows/upload-tarball.yml @@ -53,26 +53,13 @@ jobs: include: ${{ fromJSON(needs.matrix.outputs.matrix) }} env: archname: ${{ matrix.archname }} - FETCH_BRANCH: ${{ matrix.fetch_branch }} - VERSION: ${{ matrix.version }} steps: - - name: Install libraries - run: | - set -x - sudo apt-get update -q || : - sudo apt-get install --no-install-recommends -q -y build-essential git bison autoconf ruby p7zip-full curl - - name: Checkout ruby/ruby - run: git clone --single-branch --depth=1 https://github.com/ruby/ruby ruby - - name: Fetch branches and notes - run: | - set -x - cd ruby - git fetch --shallow-since='2018-12-25 00:00:00' - [ -n "$FETCH_BRANCH" ] && git fetch origin "+$FETCH_BRANCH:$FETCH_BRANCH" - git fetch origin '+refs/notes/commits:refs/notes/commits' - git fetch origin '+refs/notes/log-fix:refs/notes/log-fix' - - name: Make snapshot - run: ruby ruby/tool/make-snapshot -archname=$archname -srcdir=ruby -packages=gzip,xz,zip pkg $VERSION + - uses: ruby/ruby/.github/actions/make-snapshot@master + with: + archname: ${{ matrix.archname }} + version: ${{ matrix.version }} + fetch-branch: ${{ matrix.fetch_branch }} + upload-artifact: 'false' - name: Check pkg run: | set -x From 7b140b079f9b9cd7f9e13eb07f6799282a4fa69e Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 21 May 2026 14:36:05 +0900 Subject: [PATCH 2/3] Use ruby/ruby's make-snapshot composite action in draft-release Replace the inlined apt setup, ruby/ruby clone, tag fetch, and tool/make-snapshot call in draft-release.yml with a single ruby/ruby/.github/actions/make-snapshot@master step. The tag-ref derivation stays in the info step and is forwarded via the fetch-branch input (the composite's "git fetch +X:X" handles tag refspecs as well as branches). upload-artifact stays at its default true so the downstream ubuntu/macos/windows test jobs can still download the Packages artifact. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/draft-release.yml | 74 +++++++++++------------------ 1 file changed, 29 insertions(+), 45 deletions(-) diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 698b5bf..0f983a5 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -18,53 +18,37 @@ jobs: make-snapshot: runs-on: ubuntu-latest steps: - - name: Set TARGET_VERSION + - name: Set TARGET_VERSION and FETCH_REF run: | if [ -z "$TARGET_VERSION" ]; then GITHUB_REF=${GITHUB_EVENT_ACTION:-$(echo $GITHUB_REF | sed -e "s#/draft/#/#")} TARGET_VERSION=$(echo $GITHUB_REF | sed -e "s#refs/tags/v##" -e "s/_\([a-z]\)/-\1/" -e "y/_/./") fi - echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_ENV - echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_OUTPUT + if ruby -e "major = Integer('${TARGET_VERSION}'.split('.', 2).first); exit(major>=4)"; then + FETCH_REF="refs/tags/v${TARGET_VERSION}" + else + FETCH_REF="refs/tags/v$(echo $TARGET_VERSION | sed 'y/.-/__/')" + fi + # e.g. GITHUB_REF=refs/tags/draft/v2_7_0_preview1 -> TARGET_VERSION=2.7.0-preview1 + { + echo TARGET_VERSION="$TARGET_VERSION" + echo PACKAGE_EXTS=".tar.gz .tar.xz .zip" + } >> $GITHUB_ENV + { + echo "target_version=$TARGET_VERSION" + echo "fetch_ref=$FETCH_REF" + } >> "$GITHUB_OUTPUT" shell: bash id: info env: GITHUB_EVENT_ACTION: ${{ github.event.action }} # repository_dispatch TARGET_VERSION: ${{ github.event.inputs.TARGET_VERSION }} # workflow_dispatch - - name: Install libraries - run: | - set -x - sudo apt-get update -q || : - sudo apt-get install --no-install-recommends -q -y build-essential git bison autoconf ruby p7zip-full curl - - name: Checkout ruby/ruby for tool/make-snapshot - run: git clone --single-branch --depth=1 https://github.com/ruby/ruby ruby - - name: Make pkg - run: | - set -x - if ruby -e "major = Integer('${TARGET_VERSION}'.split('.', 2).first); exit(major>=4)"; then - GITHUB_REF_RUBY_RUBY="refs/tags/v${TARGET_VERSION}" - else - GITHUB_REF_RUBY_RUBY="refs/tags/v$(echo $TARGET_VERSION | sed 'y/.-/__/')" - fi - # e.g. GITHUB_REF=refs/tags/draft/v2_7_0_preview1 -> TARGET_VERSION=2.7.0-preview1 - pushd ruby - git fetch --shallow-since='2018-12-25 00:00:00' - git fetch origin "+${GITHUB_REF_RUBY_RUBY}:${GITHUB_REF_RUBY_RUBY}" - git fetch origin +refs/notes/commits:refs/notes/commits - git fetch origin +refs/notes/log-fix:refs/notes/log-fix - popd - # exclude bzip from -packages - ruby ruby/tool/make-snapshot -srcdir=ruby -packages=gzip,xz,zip pkg ${TARGET_VERSION} - echo PACKAGE_EXTS=".tar.gz .tar.xz .zip" >> $GITHUB_ENV - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: Packages - path: pkg - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + - uses: ruby/ruby/.github/actions/make-snapshot@master with: - name: Info - path: pkg/info + archname: ruby-${{ steps.info.outputs.target_version }} + version: ${{ steps.info.outputs.target_version }} + fetch-branch: ${{ steps.info.outputs.fetch_ref }} - name: Check pkg run: | set -x @@ -91,9 +75,9 @@ jobs: payload: | { "attachments": [{ - "title": "Build Draft Release ${{ steps.info.outputs.TARGET_VERSION }}", + "title": "Build Draft Release ${{ steps.info.outputs.target_version }}", "title_link": "https://cache.ruby-lang.org/pub/tmp/", - "text": "${{ job.status }}: make-snapshot ", + "text": "${{ job.status }}: make-snapshot ", "color": "danger" }] } @@ -105,9 +89,9 @@ jobs: payload: | { "attachments": [{ - "title": "Build Draft Release ${{ steps.info.outputs.TARGET_VERSION }}", + "title": "Build Draft Release ${{ steps.info.outputs.target_version }}", "title_link": "https://cache.ruby-lang.org/pub/tmp/", - "text": "${{ job.status }}: make-snapshot ", + "text": "${{ job.status }}: make-snapshot ", "color": "good" }] } @@ -233,7 +217,7 @@ jobs: payload: | { "attachments": [{ - "text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} ", + "text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} ", "color": "danger" }] } @@ -245,7 +229,7 @@ jobs: payload: | { "attachments": [{ - "text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} ", + "text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} ", "color": "good" }] } @@ -351,7 +335,7 @@ jobs: payload: | { "attachments": [{ - "text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} ", + "text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} ", "color": "danger" }] } @@ -363,7 +347,7 @@ jobs: payload: | { "attachments": [{ - "text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} ", + "text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} ", "color": "good" }] } @@ -498,7 +482,7 @@ jobs: payload: | { "attachments": [{ - "text": "${{ job.status }}: ${{ matrix.os }} (vs${{ matrix.vs }}) / ${{ matrix.test_task }} ", + "text": "${{ job.status }}: ${{ matrix.os }} (vs${{ matrix.vs }}) / ${{ matrix.test_task }} ", "color": "danger" }] } @@ -510,7 +494,7 @@ jobs: payload: | { "attachments": [{ - "text": "${{ job.status }}: ${{ matrix.os }} (vs${{ matrix.vs }}) / ${{ matrix.test_task }} ", + "text": "${{ job.status }}: ${{ matrix.os }} (vs${{ matrix.vs }}) / ${{ matrix.test_task }} ", "color": "good" }] } From 07976595e4ef018ff39edddd7a57c9133d04ad30 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 21 May 2026 15:38:08 +0900 Subject: [PATCH 3/3] Use lowercase target_version output across all info steps The ubuntu/macos/windows jobs each have their own Set TARGET_VERSION step that emits TARGET_VERSION (uppercase) to GITHUB_OUTPUT, while the Slack payloads now reference steps.info.outputs.target_version (lowercase) to match the make-snapshot job. Switch every info step to emit target_version so the Slack references resolve correctly across all jobs. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/draft-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 0f983a5..e6109ff 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -115,7 +115,7 @@ jobs: TARGET_VERSION=$(echo $GITHUB_REF | sed -e "s#refs/tags/v##" -e "s/_\([a-z]\)/-\1/" -e "y/_/./") fi echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_ENV - echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_OUTPUT + echo "target_version=$TARGET_VERSION" >> "$GITHUB_OUTPUT" shell: bash id: info env: @@ -256,7 +256,7 @@ jobs: TARGET_VERSION=$(echo $GITHUB_REF | sed -e "s#refs/tags/v##" -e "s/_\([a-z]\)/-\1/" -e "y/_/./") fi echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_ENV - echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_OUTPUT + echo "target_version=$TARGET_VERSION" >> "$GITHUB_OUTPUT" shell: bash id: info env: @@ -375,7 +375,7 @@ jobs: TARGET_VERSION=$(echo $GITHUB_REF | sed -e "s#refs/tags/v##" -e "s/_\([a-z]\)/-\1/" -e "y/_/./") fi echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_ENV - echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_OUTPUT + echo "target_version=$TARGET_VERSION" >> "$GITHUB_OUTPUT" shell: bash id: info env: