Skip to content

Commit

Permalink
ci: prep for prerelease
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Apr 11, 2024
1 parent 861f664 commit b79973a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/onRelease.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
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:
description: tag that needs to publish
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit b79973a

Please sign in to comment.