Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Commit

Permalink
disable gpr publish, set version with tag
Browse files Browse the repository at this point in the history
  • Loading branch information
hewigovens committed Jul 7, 2020
1 parent 440b013 commit 8be689a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 21 deletions.
41 changes: 21 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,30 @@ jobs:
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: tools/set-tag-version
- name: npm install
run: |
npm ci && npm run build && npm test
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
publish-gpr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://npm.pkg.github.com/
- name: npm install
run: |
npm config set //npm.pkg.github.com/:_authToken=${TOKEN}
npm ci && npm run build && npm test
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: npm publish
run: |
echo "registry=https://npm.pkg.github.com/trustwallet" >> .npmrc
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
# publish-gpr:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v1
# with:
# node-version: 14
# registry-url: https://npm.pkg.github.com/
# - name: npm install
# run: |
# npm config set //npm.pkg.github.com/:_authToken=${TOKEN}
# npm ci && npm run build && npm test
# env:
# TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: npm publish
# run: |
# echo "registry=https://npm.pkg.github.com/trustwallet" >> .npmrc
# npm publish --access public
# env:
# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@
"files": [
"dist"
]
}
}
15 changes: 15 additions & 0 deletions tools/set-tag-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env node

const path = require('path');
const fs = require('fs');
const child_process = require('child_process');

const package_json = '../package.json';

const tag = child_process.execSync('git describe --long --tags | cut -f 1 -d "-"')
.toString()
.replace('\n', '');
const package = require(path.resolve(__dirname, package_json));

package.version = tag;
fs.writeFileSync(path.resolve(__dirname, package_json), JSON.stringify(package, null, 2));

0 comments on commit 8be689a

Please sign in to comment.