Skip to content

Commit

Permalink
Merge pull request #51 from creative-commoners/pulls/1.7/beta-again
Browse files Browse the repository at this point in the history
FIX Use a beta version of installer
  • Loading branch information
GuySartorelli authored Mar 15, 2023
2 parents 70670a6 + 0ba9df0 commit b72db2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions job_creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ public function createJson(string $yml): string
$inputs = $this->getInputs($yml);
// $myRef will either be a branch for push (i.e cron) and pull-request (target branch), or a semver tag
$myRef = $inputs['github_my_ref'];
$isTag = preg_match('#^([0-9]+)\.([0-9]+)\.[0-9]+$#', $myRef, $m)
|| preg_match('#^([0-9]+)\.([0-9]+)\.[0-9]+-(alpha|beta|rc)[0-9]+$#', $myRef, $m);
$unstableTagRx = '#^([0-9]+)\.([0-9]+)\.[0-9]+-((alpha|beta|rc))[0-9]+$#';
$isTag = preg_match('#^([0-9]+)\.([0-9]+)\.[0-9]+$#', $myRef, $m) || preg_match($unstableTagRx, $myRef, $m);
$this->branch = $isTag ? sprintf('%d.%d', $m[1], $m[2]) : $myRef;

// parent branch is a best attempt to get the parent branch of the branch via bash
Expand All @@ -489,6 +489,9 @@ public function createJson(string $yml): string

$this->githubRepository = $inputs['github_repository'];
$this->installerVersion = $this->getInstallerVersion();
if (preg_match($unstableTagRx, $myRef, $m)) {
$this->installerVersion = str_replace('.x-dev', '.0-' . $m[3] . '1', $this->installerVersion);
}

$run = [];
$extraJobs = [];
Expand Down
2 changes: 1 addition & 1 deletion tests/JobCreatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ public function provideGitHubMyRefTags(): array
return [
['4.10', '4.10.x-dev'],
['4.10.6', '4.10.x-dev'],
['5.0.0-beta1', '5.0.x-dev'],
['5.0.0-beta2', '5.0.0-beta1'],
];
}

Expand Down

0 comments on commit b72db2e

Please sign in to comment.