Skip to content

Commit

Permalink
1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Jan 23, 2020
1 parent b1d893b commit 25e170b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 5 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"bugs": {
"url": "https://github.com/goto-bus-stop/setup-zig/issues"
Expand Down

0 comments on commit 25e170b

Please sign in to comment.