@smbcloud / cli / commits / 303ef52

Use git tag version

Seto Elkahfi committed Apr 7, 2023 at 14:53 UTC 303ef523614b1f72cbb2299b95a158721978e526
2 files changed +17 -7
.github/workflows/release-npm.yml
+11
@@ -125,6 +125,10 @@ jobs:
125 - name: Checkout
126 uses: actions/checkout@v3
127
128 + - name: Set the release version
129 + shell: bash
130 + run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
131 +
132 - name: Install node
133 uses: actions/setup-node@v3
134 with:
@@ -135,6 +139,13 @@ jobs:
139 shell: bash
140 run: |
141 cd npm/smbpndk-cli
142 +
143 + # set the version
144 + export release_version="${{ env.RELEASE_VERSION }}"
145 +
146 + # use the tag version
147 + envsubst < package.json.tmpl > "./package.json"
148 +
149 yarn install # requires optional dependencies to be present in the registry
150 yarn build
151 npm publish --access public
npm/smbpndk-cli/package.json.tmpl renamed
+6 -7
@@ -1,6 +1,6 @@
1 {
2 "name": "@smbpndk/cli",
3 - "version": "0.1.0",
3 + "version": "${release_version}",
4 "bin": {
5 "smb": "lib/index.js"
6 },
@@ -21,11 +21,10 @@
21 "typescript": "^4.9.4"
22 },
23 "optionalDependencies": {
24 - "@smbpndk/cli-darwin-arm64": "0.1.0",
25 - "@smbpndk/cli-darwin-x64": "0.1.0",
26 - "@smbpndk/cli-linux-arm64": "0.1.0",
27 - "@smbpndk/cli-linux-x64": "0.1.0",
28 - "@smbpndk/cli-windows-arm64": "0.1.0",
29 - "@smbpndk/cli-windows-x64": "0.1.0"
24 + "@smbpndk/cli-darwin-arm64": "${release_version}",
25 + "@smbpndk/cli-darwin-x64": "${release_version}",
26 + "@smbpndk/cli-linux-x64": "${release_version}",
27 + "@smbpndk/cli-windows-arm64": "${release_version}",
28 + "@smbpndk/cli-windows-x64": "${release_version}"
29 }
30 }
\ No newline at end of file