Skip to content

Commit

Permalink
fix: fix support for go beta releases
Browse files Browse the repository at this point in the history
closes actions#96
  • Loading branch information
pjvds committed Jan 19, 2021
1 parent 3b4dc6c commit 8d4bdb5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
go: [1.12.16, 1.13.11, 1.14.3]
go: [1.12.16, 1.13.11, 1.14.3, 1.16beta1]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
4 changes: 3 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5161,7 +5161,9 @@ function findMatch(versionSpec, stable) {
core.debug(`matched ${candidate.version}`);
match = candidate;
break;
}
} else {
core.debug(`version statisfied ${candidateversion}, but coulnd't find supported platform and/or architecture`);
}
}
}
if (match && goFile) {
Expand Down
16 changes: 11 additions & 5 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,17 @@ export async function findMatch(
version = version + '.0';
}

core.debug(`check ${version} satisfies ${versionSpec}`);
if (
semver.satisfies(version, versionSpec) &&
(!stable || candidate.stable === stable)
) {
let satisfied = semver.satisfies(version, versionSpec);

if(!satisfied) {
core.debug(`${version} doesn't satisfy ${versionSpec}`);
continue;
}

core.debug(`${version} does satisfy ${versionSpec}`);

if (!stable || candidate.stable === stable)
{
goFile = candidate.files.find(file => {
core.debug(
`${file.arch}===${archFilter} && ${file.os}===${platFilter}`
Expand Down

0 comments on commit 8d4bdb5

Please sign in to comment.