From 24d4106b18bf2c42d42ceae1e5b95c3d64e587ec Mon Sep 17 00:00:00 2001 From: Simon Paitrault Date: Tue, 19 Mar 2024 16:03:12 +0100 Subject: [PATCH] chore: adding pre-release npm/docker Signed-off-by: Simon Paitrault --- .github/workflows/docker_build_push.yml | 2 +- .github/workflows/docker_utils.yml | 1 + .github/workflows/npm-package.yml | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_build_push.yml b/.github/workflows/docker_build_push.yml index 4471730..774e7f5 100644 --- a/.github/workflows/docker_build_push.yml +++ b/.github/workflows/docker_build_push.yml @@ -5,7 +5,7 @@ on: branches: main pull_request: release: - types: [created] + types: [published] workflow_dispatch: concurrency: diff --git a/.github/workflows/docker_utils.yml b/.github/workflows/docker_utils.yml index 112b875..8f86d83 100644 --- a/.github/workflows/docker_utils.yml +++ b/.github/workflows/docker_utils.yml @@ -43,6 +43,7 @@ jobs: tags: | type=ref,event=branch type=ref,event=pr + type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.action == 'published' && github.event.release.prerelease == false }} type=raw,value=test,enable={{is_default_branch}} type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} diff --git a/.github/workflows/npm-package.yml b/.github/workflows/npm-package.yml index 3bc6322..dbb2313 100644 --- a/.github/workflows/npm-package.yml +++ b/.github/workflows/npm-package.yml @@ -14,6 +14,13 @@ jobs: scope: '@topos-protocol' - run: npm ci - run: npm run build + + - run: npm publish --access public --tag next + if: "github.event.release.prerelease" + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - run: npm publish --access public + if: "!github.event.release.prerelease" env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}