Skip to content

Commit

Permalink
chore: more canary adjustments...
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ru4l committed Aug 19, 2021
1 parent fba6c78 commit ae01a8c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ jobs:
npm-token: ${{ secrets.NODE_AUTH_TOKEN }}
npm-script: 'yarn release:canary'
changesets: true
env:
ON_DEMAND: ${{github.event.inputs.onDemand}}
NPM_TAG: ${{github.event.inputs.npmTag || 'alpha'}}
NPM_VERSION_SUFFIX: ${{github.event.inputs.npmVersionSuffix}}
- name: Publish a message
if: steps.canary.outputs.released
uses: 'kamilkisiela/pr-comment@master'
Expand Down
9 changes: 6 additions & 3 deletions scripts/canary-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ const applyReleasePlan = require("@changesets/apply-release-plan").default;
const { getPackages } = require("@manypkg/get-packages");

function getNewVersion(version, type) {
const gitHash = cp.spawnSync('git', ['rev-parse', '--short', 'HEAD']).stdout.toString().trim();

return semver.inc(version, `pre${type}`, true, 'alpha-' + gitHash);
let npmVersionSuffix = process.env.NPM_VERSION_SUFFIX;
if (!npmVersionSuffix) {
const gitHash = cp.spawnSync('git', ['rev-parse', '--short', 'HEAD']).stdout.toString().trim();
npmVersionSuffix = `alpha-${gitHash}`;
}
return semver.inc(version, `pre${type}`, true, npmVersionSuffix);
}

function getRelevantChangesets(baseBranch) {
Expand Down

0 comments on commit ae01a8c

Please sign in to comment.