Skip to content

Commit

Permalink
Apply fix to support GPR
Browse files Browse the repository at this point in the history
  • Loading branch information
Wickramaranga Abeygunawardhana committed Dec 20, 2019
1 parent 6baddf6 commit 4d39be3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 12
# - run: npm ci
# - run: npm test
# - run: npm ci
# - run: npm test

publish-npm:
needs: build
Expand All @@ -24,7 +24,7 @@ jobs:
with:
node-version: 12
registry-url: https://registry.npmjs.org/
# - run: npm ci
# - run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
Expand All @@ -38,8 +38,8 @@ jobs:
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
scope: '@umstek'
# - run: npm ci
scope: "@umstek"
- run: npm run ci-gpr
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.gpr_token}}
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/scripts
.github
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"author": "Wickramaranga Abeygunawardhana <[email protected]>",
"main": "index.js",
"scripts": {
"ci-gpr": "node scripts/prepare-gpr.js",
"test": "echo \"Error: No tests rn :(. \" && exit 1"
},
"dependencies": {
Expand Down
10 changes: 10 additions & 0 deletions scripts/prepare-gpr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const fs = require("fs").promises;

const GH_USERNAME = "umstek";

(async function Prepare() {
const buffer = await fs.readFile("package.json");
const object = JSON.parse(buffer.toString());
object.name = `@${GH_USERNAME}/${object.name}`;
await fs.writeFile("package.json", JSON.stringify(object, null, 2));
})();

0 comments on commit 4d39be3

Please sign in to comment.