Skip to content

Commit

Permalink
feat(ci): add publish workflow for secrets SDK
Browse files Browse the repository at this point in the history
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
  • Loading branch information
traeok committed Jul 24, 2023
1 parent 90fd778 commit bc383ea
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 47 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/secrets-sdk-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

name: Secrets SDK Publish
"on":
workflow_dispatch:

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true
cache: npm
- name: Install dependencies
run: npm ci
- name: Publish
working-directory: packages/secrets
run: |
npx -y npm-cli-login
npm publish --access public
npm dist-tag @zowe/secrets-for-zowe-sdk@$(cat package.json | jq -r .version) zowe-v2-lts
npm dist-tag @zowe/secrets-for-zowe-sdk@$(cat package.json | jq -r .version) next
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_USER: ${{ secrets.ARTIFACTORY_USERNAME }}
NPM_PASS: ${{ secrets.ARTIFACTORY_PASSWORD }}
NPM_EMAIL: ${{ secrets.ZOWE_ROBOT_EMAIL }}
NPM_SCOPE: "@zowe"
46 changes: 0 additions & 46 deletions .github/workflows/secrets-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,49 +275,3 @@ jobs:
set -e
apk add dbus gnome-keyring libsecret
dbus-run-session -- sh packages/secrets/scripts/linux-test.sh
publish:
defaults:
run:
working-directory: packages/secrets
name: Publish
runs-on: ubuntu-latest
needs:
# - build-freebsd
- test
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true
cache: npm
- name: Install dependencies
run: npm ci
working-directory: .
- name: Package
run: npm run prepublishOnly && npm pack
env:
GH_TOKEN: ${{ github.token }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: npm-package
path: "*.tgz"
if-no-files-found: error
# - name: Publish
# run: |
# if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
# then
# echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
# npm publish --access public
# elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
# then
# echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
# npm publish --tag next --access public
# else
# echo "Not a release, skipping publish"
# fi
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
10 changes: 9 additions & 1 deletion packages/secrets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"repository": "https://github.com/zowe/zowe-cli.git",
"author": "Zowe",
"version": "7.17.0",
"homepage": "https://github.com/zowe/zowe-cli/tree/master/packages/secrets#readme",
"bugs": {
"url": "https://github.com/zowe/zowe-cli/issues"
},
"main": "index.js",
"types": "index.d.ts",
"files": [
Expand All @@ -12,7 +16,10 @@
"index.d.ts",
"index.js"
],
"license": "MIT",
"publishConfig": {
"registry": "https://zowe.jfrog.io/zowe/api/npm/npm-local-release/"
},
"license": "EPL-2.0",
"devDependencies": {
"@napi-rs/cli": "^2.16.2",
"ava": "^4.3.3"
Expand All @@ -28,6 +35,7 @@
"build": "cd src/keyring && napi build --config napi.json --js false --platform --release",
"build:debug": "cd src/keyring && napi build --config napi.json --js false --platform",
"install": "node src/keyring/index.js || yarn rebuild",
"prepack": "node ../../scripts/prepareLicenses.js",
"prepublishOnly": "bash scripts/prebuildify.sh",
"rebuild": "npx --yes --package=@napi-rs/cli@2.16.2 -- napi build --config src/keyring/napi.json --cargo-cwd src/keyring --platform --release --js=false src/keyring",
"test": "ava",
Expand Down

0 comments on commit bc383ea

Please sign in to comment.