From 849deca8f1e6636ed0af32a8a0ad6909410e8b14 Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Tue, 29 Oct 2024 09:08:18 +0300 Subject: [PATCH] ci: use run_id as snapshot id --- .github/workflows/npm-publish-from-pr.yml | 2 +- src/scripts/build-from-remote.mts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/npm-publish-from-pr.yml b/.github/workflows/npm-publish-from-pr.yml index 38db5c6..d74cc0f 100644 --- a/.github/workflows/npm-publish-from-pr.yml +++ b/.github/workflows/npm-publish-from-pr.yml @@ -67,5 +67,5 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - npm version $(node --eval="process.stdout.write(require('./package.json').version)")-pr.$(git rev-parse --short HEAD) --no-git-tag-version + npm version $(node --eval="process.stdout.write(require('./package.json').version)")-pr.${{ github.run_id }} --no-git-tag-version npm publish --provenance --access=public --no-git-tag-version --tag pr diff --git a/src/scripts/build-from-remote.mts b/src/scripts/build-from-remote.mts index 44e7027..c8752f4 100644 --- a/src/scripts/build-from-remote.mts +++ b/src/scripts/build-from-remote.mts @@ -17,6 +17,7 @@ export interface TContext { repoCommit: string npmToken: string npmRegistry: string + output?: string } export const protect = (env = process.env) => { @@ -71,6 +72,7 @@ export const buildFromRemote = async (av = argv, env = process.env)=> { const ctx = createContext(av, env) await fetchSource(ctx) await buildSource(ctx) + ctx.output && await fs.outputJson(ctx) } ;(async() => {