Skip to content

Commit

Permalink
feat: prerelease check
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Oct 11, 2022
1 parent c9e6a20 commit b81b98b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/onPreRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# test
name: publish

on:
release:
types: [prereleased]
# 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:
whatsTheTag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.versionSuffix.outputs.match }}
steps:
- uses: notiz-dev/github-action-json-property@2192e246737701f108a4571462b76c75e7376216
id: packageVersion
with:
path: 'package.json'
prop_path: 'version'
- run: echo "found version ${{ steps.packageVersion.outputs.prop }}"
- uses: actions-ecosystem/action-regex-match@9e6c4fb3d5e898f505be7a1fb6e7b0a278f6665b
id: versionSuffix
with:
text: ${{ steps.packageVersion.outputs.prop }}
regex: '(?<=\d*\.\d*\.\d*-).*(?=\.\d)'
- run: echo "found tag ${{ steps.versionSuffix.outputs.match }}"
npm:
uses: salesforcecli/github-workflows/.github/workflows/npmPublish.yml@main
needs: [whatsTheTag]
with:
tag: ${{ needs.whatsTheTag.outputs.tag }}
githubTag: ${{ github.event.release.tag_name || inputs.tag }}

secrets: inherit
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@salesforce/test-plugin117",
"version": "1.11.4",
"version": "1.11.4-test.0",
"author": "Vamsi-Mundra-Salesforce",
"bugs": "https://github.com/salesforcecli/testPackageRelease/issues",
"dependencies": {
Expand Down Expand Up @@ -91,4 +91,4 @@
"publishConfig": {
"access": "public"
}
}
}

0 comments on commit b81b98b

Please sign in to comment.