From 7cb85111e418024288491079791a51c9fbe1d277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Tue, 5 Apr 2022 14:26:17 +0200 Subject: [PATCH] fix: add release action to support npm and cdn --- .../workflows/{release_to_cdn.yml => release.yml} | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) rename frontend/.github/workflows/{release_to_cdn.yml => release.yml} (73%) diff --git a/frontend/.github/workflows/release_to_cdn.yml b/frontend/.github/workflows/release.yml similarity index 73% rename from frontend/.github/workflows/release_to_cdn.yml rename to frontend/.github/workflows/release.yml index d63bf671ec..f6254319b0 100644 --- a/frontend/.github/workflows/release_to_cdn.yml +++ b/frontend/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: 'Release static assets to CDN' +name: 'Release unleash-frontend' on: push: tags: @@ -28,7 +28,13 @@ jobs: - name: Get the version id: get_version run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - - name: Deploy static assets to S3 + - name: Publish to NPM + run: | + TAG=$(echo $GITHUB_REF_NAME | grep -oP '^v\d+\.\d+\.\d+-?\K(\w+)?') + npm publish --tag ${TAG:-latest} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Publish static assets to S3 run: | aws s3 cp build/ s3://getunleash-static/unleash/${{ steps.get_version.outputs.VERSION }} --recursive