File tree Expand file tree Collapse file tree 3 files changed +21
-22
lines changed
Expand file tree Collapse file tree 3 files changed +21
-22
lines changed Original file line number Diff line number Diff line change 22
33if [[ $GITHUB_REF == refs/tags/v* ]]
44then
5- if [[ $GITHUB_ACTOR != ' dependabot[bot]' ]]
6- then
7-
8- if [[ $GITHUB_PRE_RELEASE == true ]]
9- then
10- echo " PRE_RELEASE"
11- elif [[ $GITHUB_COMMITISH == ' main' ]]
12- then
13- echo " RELEASE"
14- fi
15- else
16- echo " Dependabot has no permission to publish!"
17- exit 1
18- fi
5+ if [[ $GITHUB_ACTOR != ' dependabot[bot]' ]]
6+ then
7+ if [[ $GITHUB_COMMITISH == ' main' && $GITHUB_PRE_RELEASE == false ]]
8+ then
9+ echo " RELEASE"
10+ else
11+ echo " PRE_RELEASE"
12+ fi
13+ else
14+ echo " Dependabot has no permission to publish!"
15+ exit 1
16+ fi
1917else
20- echo " Your tag has to start with 'v'"
21- exit 1
18+ echo " Your tag has to start with 'v'"
19+ exit 1
2220fi
Original file line number Diff line number Diff line change 1313echo " 🛠 Forge all packages version numbers"
1414echo " which package version ?: $VALID_SEMVER_VERSION "
1515
16- npm version --no-git-tag-version " $VALID_SEMVER_VERSION "
16+ npm version --no-git-tag-version " $VALID_SEMVER_VERSION "
1717
1818echo " 📦 Create packages"
19- npm pack --quiet
19+ npm pack --quiet
2020
2121TAG=" latest"
22- if [[ $PRE_RELEASE == ' true' ]]; then
22+ if [[ " $GITHUB_COMMITISH " =~ v[0-9]+ ]]; then
23+ TAG=$GITHUB_COMMITISH
24+ elif [[ $PRE_RELEASE == ' true' ]]; then
2325 TAG=" next"
2426fi
2527
26- echo " 📰 Publish Package to Registry with tag: $TAG ) "
28+ echo " 📰 Publish Package to Registry with tag: $TAG "
2729for REGISTRY in ' GITHUB' ' NPM'
2830do
2931 echo " 🔒 Authenticate $REGISTRY NPM Registry"
Original file line number Diff line number Diff line change 2020 publish :
2121 name : Publish latest package versions to GitHub Packages
2222 runs-on : ubuntu-latest
23- strategy :
24- fail-fast : false
2523 steps :
2624 - name : ⬇ Checkout repo
2725 uses : actions/checkout@v3
4341 RELEASE : ${{ inputs.release }}
4442 PRE_RELEASE : ${{ inputs.preRelease }}
4543 VALID_SEMVER_VERSION : ${{ inputs.version }}
44+ GITHUB_COMMITISH : ${{ github.event.release.target_commitish }}
4645 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
4746 GPR_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4847
You can’t perform that action at this time.
0 commit comments