diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d09e4b..e6fc00e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## 1.2.0 +* Allow setting `version: master` to get the latest build from the development branch. + ## 1.1.0 * Load the zig binaries from tool cache if available. * Use the ziglang.org download index instead of downloading from Github Releases. diff --git a/dist/index.js b/dist/index.js index 7b51475..f0574e0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1125,8 +1125,10 @@ async function downloadZig (version) { const index = await getJSON({ url: 'https://ziglang.org/download/index.json' }) - const availableVersions = Object.keys(index).filter((v) => semver.valid(v)) - const useVersion = semver.maxSatisfying(availableVersions, version) + const availableVersions = Object.keys(index) + const useVersion = semver.valid(version) + ? semver.maxSatisfying(availableVersions.filter((v) => semver.valid(v)), version) + : null const meta = index[useVersion || version] if (!meta || !meta[host]) { @@ -1150,7 +1152,7 @@ async function downloadZig (version) { async function main () { const version = actions.getInput('version') || '0.5.0' - if (semver.lt(version, '0.3.0')) { + if (semver.valid(version) && semver.lt(version, '0.3.0')) { actions.setFailed('This action does not work with Zig 0.1.0 and Zig 0.2.0') return } diff --git a/package.json b/package.json index efc5261..63eee8e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "setup-zig", "description": "Use the zig compiler in your Github Action", - "version": "1.1.0", + "version": "1.2.0", "author": "Renée Kooi ", "bugs": { "url": "https://github.com/goto-bus-stop/setup-zig/issues"