Skip to content

Commit

Permalink
chore(infra): Don't publish new nightly version if nothing changed (s…
Browse files Browse the repository at this point in the history
…jbarag#633)

We previously published a new nightly build every night, but there was
no difference between many of those builds.  It's pretty silly to make
npmjs.com keep storing the same package with a different version all the
time.  Stop publishing nightly builds when there are no commits since
last night's build.
  • Loading branch information
sjbarag authored Mar 30, 2021
1 parent 9255a1d commit 9d3e411
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/nightly-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,28 @@
runs-on: "ubuntu-latest",
steps: [
{ uses: "actions/checkout@v2" },
{
id: "commits_since_last_nightly",
name: "Check for commits since last night's build",
run: "test -n \"$(git log --oneline --since '25 hours ago')\"",
"continue-on-error": true
},
{
name: "Set up node 12",
uses: "actions/setup-node@v1",
if: "${{ job.commits_since_last_nightly.outcome == 'failure' }}",
with: {
registry-url: "https://registry.npmjs.com",
node-version: "12"
}
},
{ run: "yarn" },
{
run: "yarn",
if: "${{ job.commits_since_last_nightly.outcome == 'failure' }}"
},
{
run: "yarn publish --no-git-tag-version --new-version `node scripts/getNightlyVersion.js` --tag nightly",
if: "${{ job.commits_since_last_nightly.outcome == 'failure' }}",
env: {
NODE_AUTH_TOKEN: "${{ secrets.NPM_PUBLISH_TOKEN }}"
}
Expand Down

0 comments on commit 9d3e411

Please sign in to comment.