Skip to content

Commit f285d46

Browse files
authored
Merge pull request #10 from mysteriumnetwork/update-myst-to-0.19.1
Use myst binary instead of mysterium_client and publish via CI
2 parents ae880f7 + efd8850 commit f285d46

File tree

7 files changed

+35
-14
lines changed

7 files changed

+35
-14
lines changed

.gitlab-ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
stages:
2+
- publish
3+
4+
variables:
5+
BUILD_TAG: $CI_COMMIT_TAG
6+
7+
publish-npm:
8+
stage: publish
9+
only: [tags]
10+
tags: [docker]
11+
image:
12+
name: node:lts-alpine
13+
script:
14+
- echo '//registry.npmjs.org/:_authToken=${NPM_PUBLISH_TOKEN}'>.npmrc
15+
- sed -i -e "s/0.0.0-dev/$BUILD_TAG/g" package.json
16+
- cat package.json
17+
- npm publish --access public

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Mysterium Client Binary Downloader
2-
[Mysterium Node](https://github.com/MysteriumNetwork/node) client binary downloader
1+
# Mysterium Binary Downloader
2+
[Mysterium Node](https://github.com/MysteriumNetwork/node) binary downloader
33

44
## Installation
55

@@ -41,19 +41,18 @@ yarn download-mysterium-client <platform> <destination_dir (optinal)>
4141
To run the binary from your project root:
4242

4343
```sh
44-
// ./node_modules/.bin/mysterium_client
45-
$(npm bin)/mysterium_client
44+
// ./node_modules/.bin/myst
45+
$(npm bin)/myst
4646
```
4747

4848
or
4949

5050
```sh
51-
yarn mysterium_client
51+
yarn myst
5252
```
5353

5454
If you installed it globally, it should appear in your $PATH:
5555

5656
```sh
57-
$ mysterium_client --help
57+
$ myst --help
5858
```
59-
File renamed without changes.
File renamed without changes.

index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const unzip = require('extract-zip');
77
const pjson = require('./package.json');
88
const version = pjson.version;
99

10-
const urlBase = 'https://github.com/MysteriumNetwork/node/releases/download/';
10+
const urlBase = 'https://github.com/MysteriumNetwork/node/releases';
1111
const binaryName = 'myst';
1212

1313
const getFileName = function (osPathPart, archPathPart, extension) {
@@ -27,8 +27,13 @@ const getDownloadInfo = function (version, osType, architecture) {
2727
default: throw new Error('Unsupported os type: ' + osType)
2828
}
2929
filename = getFileName(osPathPart, archPathPart, extension);
30+
if (version === "0.0.0-dev") {
31+
url = `${urlBase}/latest/download/${filename}`
32+
} else {
33+
url = `${urlBase}/download/${version}/${filename}`
34+
}
3035
return {
31-
url: urlBase + version + '/' + filename,
36+
url: url,
3237
filename,
3338
extension
3439
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mysterium-client-bin",
3-
"version": "0.14.1",
3+
"version": "0.0.0-dev",
44
"description": "Mysterium Network client",
55
"keywords": [
66
"mysterium",
@@ -12,12 +12,12 @@
1212
],
1313
"main": "index.js",
1414
"bin": {
15-
"download-mysterium-client": "./download-mysterium-client",
16-
"mysterium_client": "./bin/mysterium_client"
15+
"download-myst": "./download-myst",
16+
"myst": "./bin/myst"
1717
},
1818
"scripts": {
1919
"test": "echo \"Error: no test specified\" && exit 1",
20-
"postinstall": "./download-mysterium-client"
20+
"postinstall": "./download-myst"
2121
},
2222
"author": "Mysterium Network",
2323
"license": "MIT",

0 commit comments

Comments
 (0)