-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7c370a
commit 05ceb53
Showing
1 changed file
with
33 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|