Skip to content

Commit 07f42b2

Browse files
authored
ci: publish api package to github npm registry (#446)
Signed-off-by: Philippe Martin <[email protected]>
1 parent 67bccfb commit 07f42b2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/next-build.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,18 @@ jobs:
148148
with:
149149
subject-name: ghcr.io/${{ github.repository_owner }}/podman-desktop-extension-kubernetes-dashboard
150150
subject-digest: ${{ steps.push-to-ghcr.outputs.digest }}
151-
push-to-registry: true
151+
push-to-registry: true
152+
153+
- name: Set api package version
154+
run: |
155+
PACKAGE_VERSION=$(jq -r '.version' packages/api/package.json)
156+
STRIPPED_VERSION=${PACKAGE_VERSION%-next}
157+
SHORT_SHA1=$(git rev-parse --short HEAD)
158+
TAG_PATTERN=${STRIPPED_VERSION}-$(date +'%Y%m%d%H%M')-${SHORT_SHA1}
159+
echo "Using version ${TAG_PATTERN}"
160+
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${TAG_PATTERN}\",#g" packages/api/package.json
161+
162+
- name: publish api package
163+
run: pnpm publish
164+
env:
165+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)