Skip to content

Commit 7005fbe

Browse files
committed
Embed the used tag in this repo for atomic updates
* Avoids stale cached requests for the latest_release.tag file. * This also ensures reproducible builds for this repository.
1 parent 026be44 commit 7005fbe

2 files changed

Lines changed: 4 additions & 14 deletions

File tree

dist/index.js

Lines changed: 2 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const tc = require('@actions/tool-cache')
66
const axios = require('axios')
77
const windows = require('./windows')
88

9+
const builderReleaseTag = 'builds-bundler1'
910
const releasesURL = 'https://github.com/eregon/ruby-install-builder/releases'
1011
const metadataURL = 'https://raw.githubusercontent.com/eregon/ruby-install-builder/metadata'
1112

@@ -35,8 +36,7 @@ async function downloadAndExtract(platform, ruby) {
3536
const rubiesDir = `${process.env.HOME}/.rubies`
3637
await io.mkdirP(rubiesDir)
3738

38-
const tag = await getLatestReleaseTag()
39-
const url = `${releasesURL}/download/${tag}/${ruby}-${platform}.tar.gz`
39+
const url = `${releasesURL}/download/${builderReleaseTag}/${ruby}-${platform}.tar.gz`
4040
console.log(url)
4141

4242
const downloadPath = await tc.downloadTool(url)
@@ -45,11 +45,6 @@ async function downloadAndExtract(platform, ruby) {
4545
return `${rubiesDir}/${ruby}`
4646
}
4747

48-
async function getLatestReleaseTag() {
49-
const response = await axios.get(`${metadataURL}/latest_release.tag`)
50-
return response.data.trim()
51-
}
52-
5348
async function getRubyEngineAndVersion(rubyVersion) {
5449
if (rubyVersion === '.ruby-version') { // Read from .ruby-version
5550
rubyVersion = fs.readFileSync('.ruby-version', 'utf8').trim()

0 commit comments

Comments
 (0)