Skip to content

Commit 8580ffa

Browse files
committed
Update build.yml to upload to the correct release and update README
1 parent 3272a23 commit 8580ffa

File tree

2 files changed

+20
-26
lines changed

2 files changed

+20
-26
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,14 @@ jobs:
1515
runs-on: ${{ matrix.os }}
1616
steps:
1717
- uses: actions/checkout@v4
18-
- name: Set tag name
19-
id: info
20-
run: |
21-
tag=toolcache
22-
echo "tag=$tag" >> $GITHUB_OUTPUT
2318
- name: Set platform
2419
id: platform
2520
run: |
2621
platform=${{ matrix.os }}
27-
platform=${platform/macos-13/macos-latest}
28-
platform=${platform/macos-14/macos-13-arm64}
29-
platform=${platform/%-arm/-arm64}
22+
platform=${platform/macos-13/darwin-x64}
23+
platform=${platform/macos-14/darwin-arm64}
24+
platform=${platform/%.04/.04-x64}
25+
platform=${platform/%.04-arm/.04-arm64}
3026
echo "platform=$platform" >> $GITHUB_OUTPUT
3127
- name: Set ruby
3228
id: ruby
@@ -36,9 +32,10 @@ jobs:
3632
ruby="ruby-$ruby"
3733
fi
3834
echo "ruby=$ruby" >> $GITHUB_OUTPUT
35+
echo "tag=$ruby" >> $GITHUB_OUTPUT
3936
echo "archive=$ruby-${{ steps.platform.outputs.platform }}.tar.gz" >> $GITHUB_OUTPUT
4037
- name: Check if already built
41-
run: '! curl -s -L --head --fail https://github.com/ruby/ruby-builder/releases/download/${{ steps.info.outputs.tag }}/${{ steps.ruby.outputs.archive }}'
38+
run: '! curl -s -L --head --fail https://github.com/ruby/ruby-builder/releases/download/${{ steps.ruby.outputs.tag }}/${{ steps.ruby.outputs.archive }}'
4239

4340
- name: Set NO_DOCUMENT
4441
run: |
@@ -120,7 +117,9 @@ jobs:
120117
env:
121118
GH_TOKEN: ${{ github.token }}
122119
GH_REPO: ${{ github.repository }}
123-
run: gh release upload "toolcache" "${{ steps.ruby.outputs.archive }}"
120+
run: |
121+
gh release view "${{ steps.ruby.outputs.tag }}" || gh release create "${{ steps.ruby.outputs.tag }}" --notes "Builds of ${{ steps.ruby.outputs.ruby }}"
122+
gh release upload "${{ steps.ruby.outputs.tag }}" "${{ steps.ruby.outputs.archive }}"
124123
125124
buildJRubyWindows:
126125
if: false
@@ -132,17 +131,11 @@ jobs:
132131
runs-on: ${{ matrix.os }}
133132
steps:
134133
- uses: actions/checkout@v4
135-
- name: Set tag name
136-
id: info
137-
run: |
138-
tag=toolcache
139-
echo "tag=$tag" >> $GITHUB_OUTPUT
140-
shell: bash
141134
- name: Set platform
142135
id: platform
143136
run: |
144137
platform=${{ matrix.os }}
145-
platform=${platform/windows-2022/windows-latest}
138+
platform=${platform/windows-2022/windows-x64}
146139
platform=${platform/windows-11-arm/windows-arm64}
147140
echo "platform=$platform" >> $GITHUB_OUTPUT
148141
shell: bash
@@ -151,10 +144,11 @@ jobs:
151144
run: |
152145
ruby=jruby-${{ matrix.jruby-version }}
153146
echo "ruby=$ruby" >> $GITHUB_OUTPUT
147+
echo "tag=$ruby" >> $GITHUB_OUTPUT
154148
echo "archive=$ruby-${{ steps.platform.outputs.platform }}.tar.gz" >> $GITHUB_OUTPUT
155149
shell: bash
156150
- name: Check if already built
157-
run: '! curl -s -L --head --fail https://github.com/ruby/ruby-builder/releases/download/${{ steps.info.outputs.tag }}/${{ steps.ruby.outputs.archive }}'
151+
run: '! curl -s -L --head --fail https://github.com/ruby/ruby-builder/releases/download/${{ steps.ruby.outputs.tag }}/${{ steps.ruby.outputs.archive }}'
158152
shell: bash
159153

160154
# JAVA_HOME_21_AARCH64 - https://github.com/actions/partner-runner-images/blob/main/images/arm-windows-11-image.md#java
@@ -212,7 +206,9 @@ jobs:
212206
env:
213207
GH_TOKEN: ${{ github.token }}
214208
GH_REPO: ${{ github.repository }}
215-
run: gh release upload "toolcache" "${{ steps.ruby.outputs.archive }}"
209+
run: |
210+
gh release view "${{ steps.ruby.outputs.tag }}" || gh release create "${{ steps.ruby.outputs.tag }}" --notes "Builds of ${{ steps.ruby.outputs.ruby }}"
211+
gh release upload "${{ steps.ruby.outputs.tag }}" "${{ steps.ruby.outputs.archive }}"
216212
217213
218214
createPullRequest:

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The action to use these prebuilt rubies is [ruby/setup-ruby](https://github.com/
66

77
Please report issues to [ruby/setup-ruby](https://github.com/ruby/setup-ruby).
88

9-
[The latest release](https://github.com/ruby/ruby-builder/releases/latest) contains all built Rubies.
9+
There is one release per `$engine-$version` holding the corresponding built Rubies for the various platforms.
1010

1111
## Building a new Ruby release
1212

@@ -27,11 +27,9 @@ Once it's ready, mark the release as non-prerelease and switch to it in `ruby/se
2727
## Naming
2828

2929
Archives are named `$engine-$version-$platform.tar.gz`.
30+
`$arch` is either `x64` or `arm64`
3031

3132
`platform` is one of:
32-
* `ubuntu-NN.NN`: built on the corresponding GitHub-hosted runner virtual environment
33-
* `macos-latest`: built on `macos-13`, the oldest `macos-amd64` available on GitHub-hosted runners.
34-
* `macos-13-arm64`: built on `macos-14`, the oldest `macos-arm64` available on GitHub-hosted runners.
35-
* `windows-latest`: built on `windows-2022` (does not matter, it's only for repacking a JRuby archive, no actual build)
36-
37-
The names contain `-latest` for compatibility, even though what `-latest` points to for runners might have changed.
33+
* `darwin-$arch`: built on the oldest macOS GitHub-hosted runner for that arch
34+
* `ubuntu-NN.NN-$arch`: built on the corresponding GitHub-hosted runner
35+
* `windows-$arch`: built on the oldest Windows GitHub-hosted runner for that arch

0 commit comments

Comments
 (0)