Skip to content

Commit

Permalink
Support default NPM tag naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolftimmermans committed Sep 30, 2019
1 parent a4e41be commit 020dace
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,7 @@ npm version <new version>
git push && git push --tags
```

Wait for continuous integration to finish. Once all the builds are done run:
```sh
npm run dev:download-prebuild
```

This will download all the prebuilds into `./prebuilds`. To publish the tarball to `npm` run:

```sh
npm publish
```
Wait for continuous integration to finish. Prebuilds will be generated for all supported platforms and attached to a Github release. Then, a new NPM package version will be automatically released.

# API Documentation

Expand Down
6 changes: 3 additions & 3 deletions script/ci/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ const tar = require("tar-fs")
async function download() {
const {repository: {url}, version} = require(path.resolve("./package.json"))

if (process.env.TRAVIS_TAG && process.env.TRAVIS_TAG != version) {
if (process.env.TRAVIS_TAG && process.env.TRAVIS_TAG != `v${version}`) {
throw new Error(`Version mismatch (TRAVIS_TAG=${process.env.TRAVIS_TAG}, version=${version}`)
}

const [, user, repo] = url.match(/\/([a-z0-9_-]+)\/([a-z0-9_-]+)\.git$/i)

const res = await fetch(`https://api.github.com/repos/${user}/${repo}/releases/tags/${version}`)
const res = await fetch(`https://api.github.com/repos/${user}/${repo}/releases/tags/v${version}`)
if (!res.ok) {
throw new Error(`Github release ${version} not found (${res.status})`)
throw new Error(`Github release v${version} not found (${res.status})`)
}

const {assets} = await res.json()
Expand Down

0 comments on commit 020dace

Please sign in to comment.