|
10 | 10 | description: tag that needs to publish |
11 | 11 | type: string |
12 | 12 | required: true |
| 13 | + |
13 | 14 | jobs: |
14 | 15 | # parses the package.json version and detects prerelease tag (ex: beta from 4.4.4-beta.0) |
15 | 16 | getDistTag: |
16 | 17 | outputs: |
17 | 18 | tag: ${{ steps.distTag.outputs.tag }} |
18 | | - branch: ${{ steps.getBranch.outputs.branch }} |
19 | 19 | runs-on: ubuntu-latest |
20 | 20 | steps: |
21 | 21 | - uses: actions/checkout@v4 |
22 | 22 | with: |
23 | | - ref: ${{ github.event.release.tag_name || inputs.tag }} |
| 23 | + ref: ${{ github.event.release.tag_name || inputs.tag }} |
24 | 24 | - uses: salesforcecli/github-workflows/.github/actions/getPreReleaseTag@main |
25 | 25 | id: distTag |
26 | | - - name: Determine branch |
27 | | - id: getBranch |
28 | | - run: | |
29 | | - if [[ "${{ github.event_name }}" == "release" ]]; then |
30 | | - # For release events, use the target branch of the release |
31 | | - BRANCH="${{ github.event.release.target_commitish }}" |
32 | | - else |
33 | | - # For workflow_dispatch, use the current branch |
34 | | - BRANCH="${{ github.ref_name }}" |
35 | | - fi |
36 | | -
|
37 | | - # Use main if triggered from main, otherwise use prerelease/dev |
38 | | - if [[ "$BRANCH" == "main" ]]; then |
39 | | - echo "branch=main" >> $GITHUB_OUTPUT |
40 | | - else |
41 | | - echo "branch=prerelease/dev" >> $GITHUB_OUTPUT |
42 | | - fi |
43 | | - echo "Detected branch: $BRANCH, using: $(cat $GITHUB_OUTPUT | grep branch | cut -d'=' -f2)" |
44 | 26 |
|
45 | 27 | npm-publish: |
46 | 28 | if: ${{ needs.getDistTag.outputs.tag != '' }} |
47 | 29 | uses: ./.github/workflows/npm-publish.yml |
48 | 30 | needs: [getDistTag] |
49 | 31 | with: |
50 | | - branch: ${{ needs.getDistTag.outputs.branch }} |
| 32 | + tag: ${{ needs.getDistTag.outputs.tag }} |
51 | 33 | nodeVersion: 'lts/*' |
52 | 34 | secrets: inherit |
0 commit comments