Skip to content

Commit

Permalink
fix build script
Browse files Browse the repository at this point in the history
  • Loading branch information
frontegg-david committed Oct 31, 2023
1 parent a7c370a commit 05ceb53
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,37 @@ jobs:
run: yarn install
- name: "Build Packages"
run: yarn build
- name: "Authenticate with Registry"
run: |
yarn logout
echo "init-author-name=Frontegg LTD" > .npmrc
echo "[email protected]" >> .npmrc
echo "init-author-url=https://frontegg.com" >> .npmrc
echo "init-license=MIT" >> .npmrc
echo "always-auth=true" >> .npmrc
echo "registry=https://registry.npmjs.org" >> .npmrc
echo "_authToken=$NPM_PUBLISH_TOKEN" >> .npmrc
echo "@frontegg:registry=https://registry.npmjs.org" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_PUBLISH_TOKEN" >> .npmrc
npm whoami
env:
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: "Copy .npmrc .npmignore to lib folders"
uses: actions/github-script@v6
with:
script: |
const fs = require("fs");
const npmIgnore = fs.readFileSync('./.npmignore', { encoding:"utf-8" })
const npmrc = fs.readFileSync('./.npmrc', { encoding:"utf-8" })
const libs = ['harmor'];
libs.forEach(lib => {
fs.writeFileSync(`./dist/${lib}/.npmignore`, npmIgnore, { encoding:"utf-8" });
fs.writeFileSync(`./dist/${lib}/.npmrc`, npmrc, { encoding:"utf-8" });
});
- name: "Publish harmor to NPM"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: cd ./dist/harmor && chmod +x ./src/index.js && npm publish --tag latest
# - name: "Authenticate with Registry"
# run: |
# yarn logout
# echo "init-author-name=Frontegg LTD" > .npmrc
# echo "[email protected]" >> .npmrc
# echo "init-author-url=https://frontegg.com" >> .npmrc
# echo "init-license=MIT" >> .npmrc
# echo "always-auth=true" >> .npmrc
# echo "registry=https://registry.npmjs.org" >> .npmrc
# echo "_authToken=$NPM_PUBLISH_TOKEN" >> .npmrc
# echo "@frontegg:registry=https://registry.npmjs.org" >> .npmrc
# echo "//registry.npmjs.org/:_authToken=$NPM_PUBLISH_TOKEN" >> .npmrc
# npm whoami
# env:
# NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
# - name: "Copy .npmrc .npmignore to lib folders"
# uses: actions/github-script@v6
# with:
# script: |
# const fs = require("fs");
# const npmIgnore = fs.readFileSync('./.npmignore', { encoding:"utf-8" })
# const npmrc = fs.readFileSync('./.npmrc', { encoding:"utf-8" })
# const libs = ['harmor'];
# libs.forEach(lib => {
# fs.writeFileSync(`./dist/${lib}/.npmignore`, npmIgnore, { encoding:"utf-8" });
# fs.writeFileSync(`./dist/${lib}/.npmrc`, npmrc, { encoding:"utf-8" });
# });
#
# - name: "Publish harmor to NPM"
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
# run: cd ./dist/harmor && chmod +x ./src/index.js && npm publish --tag latest

0 comments on commit 05ceb53

Please sign in to comment.