From b79973acacb8034fb07074e92fbb133566f6b187 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 11 Apr 2024 18:14:32 -0500 Subject: [PATCH] ci: prep for prerelease --- .github/workflows/onRelease.yml | 22 +++++++++++++++++----- package.json | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/onRelease.yml b/.github/workflows/onRelease.yml index e647af38..db03117a 100644 --- a/.github/workflows/onRelease.yml +++ b/.github/workflows/onRelease.yml @@ -1,10 +1,9 @@ -name: On Release +name: publish -# when a github release happens, publish an npm package, on: release: - types: [released] - # support manual release + types: [published] + # support manual release in case something goes wrong and needs to be repeated or tested workflow_dispatch: inputs: tag: @@ -12,9 +11,22 @@ on: type: string required: true jobs: + # parses the package.json version and detects prerelease tag (ex: beta from 4.4.4-beta.0) + getDistTag: + outputs: + tag: ${{ steps.distTag.outputs.tag }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name || inputs.tag }} + - uses: salesforcecli/github-workflows/.github/actions/getPreReleaseTag@main + id: distTag + npm: uses: salesforcecli/github-workflows/.github/workflows/npmPublish.yml@main + needs: [getDistTag] with: - ctc: false + tag: ${{ needs.getDistTag.outputs.tag || 'latest' }} githubTag: ${{ github.event.release.tag_name || inputs.tag }} secrets: inherit diff --git a/package.json b/package.json index cc52901a..13e9acc8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@salesforce/templates", - "version": "60.1.1", + "version": "61.0.0-beta.0", "salesforceApiVersion": "59", "description": "Salesforce JS library for templates", "bugs": "https://github.com/forcedotcom/salesforcedx-templates/issues",