Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support release nightlies #63

Merged
merged 7 commits into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/example-builds-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Example builds (nightly)

on:
push:
branches: ['main', 'master', 'releases/*']
pull_request:
schedule:
- cron: '37 17 * * *'
Expand All @@ -12,6 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
julia-version: [nightly, 1.6-nightly]
julia-arch: [x64, x86]
os: [ubuntu-latest, macOS-latest, windows-latest]
# 32-bit Julia binaries are not available on macOS
Expand All @@ -28,10 +30,10 @@ jobs:
npm run build
npm run pack

- name: "Set up Julia (nightly)"
- name: "Set up Julia (${{ matrix.julia-version }})"
uses: ./
with:
version: nightly
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
show-versioninfo: 'true'
- run: julia --version
5 changes: 4 additions & 1 deletion .github/workflows/example-builds.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Example builds

on: [push, pull_request]
on:
push:
branches: ['main', 'master', 'releases/*']
pull_request:

jobs:
test:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ You can either specify specific Julia versions or version ranges. If you specify
- `^1.3.0-0` is a **caret** version range that includes _all_ pre-releases. It matches all versions `≥ 1.3.0-` and `< 2.0.0`.
- `~1.3.0-0` is a **tilde** version range that includes _all_ pre-releases. It matches all versions `≥ 1.3.0-` and `< 1.4.0`.
- `nightly` will install the latest nightly build.
- `1.6-nightly` will install the latest nightly build for the upcoming 1.6 release. This version will only be available during certain phases of the Julia release cycle.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maleadt Do you know if these nightly builds are documented anywhere? https://julialang.org/downloads/nightlies/ doesn't mention them and it would be nice to link to a page where people can check what nightly builds are available.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these are documented anywhere, except in code: https://github.com/JuliaCI/julia-buildbot/blob/37ef3e30aeeccd172f4b9c27749e70dc9f701d54/master/master.cfg#L120-L128 (and the majmin handling across those files).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, they're not really documented anywhere, but you can download a latest build of Julia overall, as well as from one of the $(major).$(minor) directories.


Internally the action uses node's semver package to resolve version ranges. Its [documentation](https://github.com/npm/node-semver#advanced-range-syntax) contains more details on the version range syntax. You can test what version will be selected for a given input in this JavaScript [REPL](https://repl.it/@SaschaMann/setup-julia-version-logic).

Expand Down
23 changes: 12 additions & 11 deletions lib/installer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 14 additions & 12 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,11 @@ export async function getJuliaVersions(versionInfo): Promise<string[]> {
}

export function getJuliaVersion(availableReleases: string[], versionInput: string): string {
if (semver.valid(versionInput) == versionInput) {
// versionInput is a valid version, use it directly
if (semver.valid(versionInput) == versionInput || versionInput.endsWith('nightly')) {
// versionInput is a valid version or a nightly version, use it directly
return versionInput
}

// nightlies
if (versionInput == 'nightly') {
return 'nightly'
}

// Use the highest available version that matches versionInput
let version = semver.maxSatisfying(availableReleases, versionInput)
if (version == null) {
Expand Down Expand Up @@ -111,7 +106,7 @@ function getNightlyFileName(arch: string): string {
}

export function getFileInfo(versionInfo, version: string, arch: string) {
if (version == 'nightly') {
if (version.endsWith('nightly')) {
return null
}

Expand All @@ -125,10 +120,17 @@ export function getFileInfo(versionInfo, version: string, arch: string) {
}

export function getDownloadURL(fileInfo, version: string, arch: string): string {
const baseURL = `https://julialangnightlies-s3.julialang.org/bin/${osMap[osPlat]}/${arch}`

// release branch nightlies, e.g. 1.6-nightlies should return .../bin/linux/x64/1.6/julia-latest-linux64.tar.gz
const majorMinorMatches = /^(\d*.\d*)-nightly/.exec(version)
if (majorMinorMatches) {
return `${baseURL}/${majorMinorMatches[1]}/${getNightlyFileName(arch)}`
}

// nightlies
if (version == 'nightly') {
const baseURL = 'https://julialangnightlies-s3.julialang.org/bin'
return `${baseURL}/${osMap[osPlat]}/${arch}/${getNightlyFileName(arch)}`
return `${baseURL}/${getNightlyFileName(arch)}`
}

return fileInfo.url
Expand All @@ -142,7 +144,7 @@ export async function installJulia(versionInfo, version: string, arch: string):
const juliaDownloadPath = await tc.downloadTool(downloadURL)

// Verify checksum
if (version != 'nightly') {
if (!version.endsWith('nightly')) {
const checkSum = await calculateChecksum(juliaDownloadPath)
if (fileInfo.sha256 != checkSum) {
throw new Error(`Checksum of downloaded file does not match the expected checksum from versions.json.\nExpected: ${fileInfo.sha256}\nGot: ${checkSum}`)
Expand All @@ -161,7 +163,7 @@ export async function installJulia(versionInfo, version: string, arch: string):
await exec.exec('tar', ['xf', juliaDownloadPath, '--strip-components=1', '-C', tempInstallDir])
return tempInstallDir
case 'win32':
if (version == 'nightly' || semver.gtr(version, '1.3', {includePrerelease: true})) {
if (version.endsWith('nightly') || semver.gtr(version, '1.3', {includePrerelease: true})) {
// The installer changed in 1.4: https://github.com/JuliaLang/julia/blob/ef0c9108b12f3ae177c51037934351ffa703b0b5/NEWS.md#build-system-changes
await exec.exec('powershell', ['-Command', `Start-Process -FilePath ${juliaDownloadPath} -ArgumentList "/SILENT /dir=${path.join(process.cwd(), tempInstallDir)}" -NoNewWindow -Wait`])
} else {
Expand Down