From 1508ff232db6cc6da5845cf40bdd3c6b8da2272a Mon Sep 17 00:00:00 2001 From: "Shah, Kevin" Date: Fri, 10 Nov 2023 13:54:08 -0500 Subject: [PATCH] Updated channel name to replace with - --- .github/workflows/release-github.yml | 5 ++--- src/js/github.io/index.mjs | 6 ------ src/js/version.mjs | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-github.yml b/.github/workflows/release-github.yml index aaa6045b8..24c6468e6 100644 --- a/.github/workflows/release-github.yml +++ b/.github/workflows/release-github.yml @@ -69,7 +69,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} # <-- Allows semantic-release-bot to push changes to protected branches npm_config_tag: ${{ env.NPM_DIST_TAG }} # <-- For main, this is `latest.` Otherwise, `next`, `next-major`, etc. See ./.releaserc for release branch config. run: npx semantic-release --dry-run - - name: Build artifacts for PRs + - name: Build artifacts for feature branches if: github.ref_name != 'main' && github.ref_name != 'next' run: | npm version prerelease --preid $RELEASE_CHANNEL --workspaces --git-tag-version false @@ -82,7 +82,6 @@ jobs: files: "./src/sdks/core/dist/lib/firebolt.mjs" - name: Release Firebolt SDKs to NPM if: steps.check_build.outputs.files_exists == 'true' && github.event_name != 'pull_request' && (github.ref_name != 'main' || github.event_name == 'workflow_dispatch') - # if: steps.check_build.outputs.files_exists == 'true' && (github.ref_name != 'main' || github.event_name == 'workflow_dispatch') env: NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} # <-- Allows semantic-release to publish to npm without 2 factor auth. npm_config_tag: ${{ env.NPM_DIST_TAG }} # <-- For main, this is `latest.` Otherwise, `next`, `next-major`, etc. See ./.releaserc for release branch config. @@ -105,7 +104,7 @@ jobs: cd /tmp git clone https://rdkcentral:$GITHUB_TOKEN@github.com/rdkcentral/firebolt.git ./firebolt-docs - name: Release docs to GitHub.io - if: (steps.check_build.outputs.files_exists == 'true' && github.event.pull_request.head.repo.full_name == 'rdkcentral/firebolt-apis') + if: steps.check_build.outputs.files_exists == 'true' env: GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} # <-- Allows semantic-release-bot to push changes to protected branches npm_config_tag: ${{ env.NPM_DIST_TAG }} # <-- For main, this is `latest.` Otherwise, `next`, `next-major`, etc. See ./.releaserc for release branch config. diff --git a/src/js/github.io/index.mjs b/src/js/github.io/index.mjs index ea6a8332b..7681a9d7f 100644 --- a/src/js/github.io/index.mjs +++ b/src/js/github.io/index.mjs @@ -177,12 +177,6 @@ function channel(version) { parts.shift() const chnl = parts.join("-").split(".").shift() return chnl - // if (['next', 'next-major', 'test'].includes(chnl)) { - // return chnl - // } - // else { - // return 'test' - // } } else { return 'latest' diff --git a/src/js/version.mjs b/src/js/version.mjs index 0d7f17cdc..8f1dec5c1 100644 --- a/src/js/version.mjs +++ b/src/js/version.mjs @@ -44,7 +44,7 @@ else if (task === 'channel') { .then(JSON.parse) // default to 'test' channel if branch is unknown - const config = releaserc.branches.find(b => b.name === branch) || { channel: branch.split('/').pop() } + const config = releaserc.branches.find(b => b.name === branch) || { channel: branch.replace('/', '-').pop() } const channel = config.channel || (!config.prerelease ? 'latest' : config.name) // return the configured channel name for the branch, otherwise return the branch name, unless it's the main branch, then return 'latest'