44 push :
55 branches :
66 - main
7- - release/[0-9]+.[0-9]+.[0-9]+
7+ - " release/** "
88 release :
99 types :
1010 - created
@@ -14,15 +14,17 @@ permissions: {}
1414
1515jobs :
1616 deliver-ghp :
17+ permissions :
18+ contents : read
19+ packages : write
20+ pages : write
1721 runs-on : ubuntu-latest
18- outputs :
19- FULL_VERSION : ${{ steps.guess-build-metadata.outputs.FULL_VERSION }}
20- DIST_TAG : ${{ steps.guess-build-metadata.outputs.DIST_TAG }}
21- TARGET_VERSION : ${{ steps.check-version.outputs.TARGET_VERSION }}
2222
2323 steps :
2424 - name : " Checkout repo"
2525 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+ with :
27+ persist-credentials : false
2628
2729 - name : " Setup node"
2830 uses : actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
4951 FULL_VERSION=$(.github/workflows/gh-semver.sh)
5052 DIST_TAG=$(.github/workflows/guess-dist-tag.sh)
5153
52- echo "FULL_VERSION=FULL_VERSION" >> "$GITHUB_OUTPUT"
54+ echo "FULL_VERSION=$ FULL_VERSION" >> "$GITHUB_OUTPUT"
5355 echo "DIST_TAG=$DIST_TAG" >> "$GITHUB_OUTPUT"
5456
5557 - name : " Run: make doc"
6668 as $DIST_TAG \
6769 with version=[$FULL_VERSION]"
6870
69- - name : " Publish to GitHub Packages"
71+ - name : " Deliver to GitHub Packages"
7072 env :
7173 DIST_TAG : ${{ steps.guess-build-metadata.outputs.DIST_TAG }}
7274 FULL_VERSION : ${{ steps.guess-build-metadata.outputs.FULL_VERSION }}
@@ -88,15 +90,17 @@ jobs:
8890 folder : lib/dist/docs
8991
9092 deliver-npmjs :
93+ permissions :
94+ contents : read
9195 runs-on : ubuntu-latest
92- needs : deliver-ghp
9396 steps :
9497 - name : " Checkout repo"
9598 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
99+ with :
100+ persist-credentials : false
96101
97102 - name : " Setup node"
98103 uses : actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
99-
100104 with :
101105 node-version : " 22"
102106 registry-url : " https://registry.npmjs.org"
@@ -105,20 +109,29 @@ jobs:
105109 run : |
106110 make all
107111
108- - name : " Publish to npmjs"
112+ - name : " Output build metadata"
113+ id : guess-build-metadata
114+ run : |
115+ FULL_VERSION=$(.github/workflows/gh-semver.sh)
116+ DIST_TAG=$(.github/workflows/guess-dist-tag.sh)
117+
118+ echo "FULL_VERSION=$FULL_VERSION" >> "$GITHUB_OUTPUT"
119+ echo "DIST_TAG=$DIST_TAG" >> "$GITHUB_OUTPUT"
120+
121+ - name : " Deliver to npmjs"
109122 env :
123+ DIST_TAG : ${{ steps.guess-build-metadata.outputs.DIST_TAG }}
124+ FULL_VERSION : ${{ steps.guess-build-metadata.outputs.FULL_VERSION }}
110125 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
111- FULL_VERSION : ${{ needs.deliver-ghp.outputs.FULL_VERSION }}
112- DIST_TAG : ${{ needs.deliver-ghp.outputs.DIST_TAG }}
113126 run : |
114127 bash scripts/deliver-to-npm-registry.sh "$FULL_VERSION" "$DIST_TAG"
115128
116129 - name : " Echo info to Run Summary"
117130 env :
118- FULL_VERSION : ${{ needs.deliver-ghp .outputs.FULL_VERSION }}
131+ FULL_VERSION : ${{ steps.guess-build-metadata .outputs.FULL_VERSION }}
119132 run : |
120133 {
121134 echo "- [Client Library](https://www.npmjs.com/package/@opentdf/sdk/v/$FULL_VERSION)"
122- echo "- [Command Line Tool](https://www.npmjs.com/package/@opentdf/ctl/v/FULL_VERSION)"
135+ echo "- [Command Line Tool](https://www.npmjs.com/package/@opentdf/ctl/v/$ FULL_VERSION)"
123136 echo "- [unpkg](https://unpkg.com/browse/@opentdf/sdk@$FULL_VERSION)"
124137 } >>"$GITHUB_STEP_SUMMARY"
0 commit comments