Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions .github/scripts/get-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@

if [[ $GITHUB_REF == refs/tags/v* ]]
then
if [[ $GITHUB_ACTOR != 'dependabot[bot]' ]]
then

if [[ $GITHUB_PRE_RELEASE == true ]]
then
echo "PRE_RELEASE"
elif [[ $GITHUB_COMMITISH == 'main' ]]
then
echo "RELEASE"
fi
else
echo "Dependabot has no permission to publish!"
exit 1
fi
if [[ $GITHUB_ACTOR != 'dependabot[bot]' ]]
then
if [[ $GITHUB_COMMITISH == 'main' && $GITHUB_PRE_RELEASE == false ]]
then
echo "RELEASE"
else
echo "PRE_RELEASE"
fi
else
echo "Dependabot has no permission to publish!"
exit 1
fi
else
echo "Your tag has to start with 'v'"
exit 1
echo "Your tag has to start with 'v'"
exit 1
fi
10 changes: 6 additions & 4 deletions .github/scripts/publish-npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ fi
echo "🛠 Forge all packages version numbers"
echo "which package version ?: $VALID_SEMVER_VERSION"

npm version --no-git-tag-version "$VALID_SEMVER_VERSION"
npm version --no-git-tag-version "$VALID_SEMVER_VERSION"

echo "📦 Create packages"
npm pack --quiet
npm pack --quiet

TAG="latest"
if [[ $PRE_RELEASE == 'true' ]]; then
if [[ "$GITHUB_COMMITISH" =~ v[0-9]+ ]];then
TAG=$GITHUB_COMMITISH
elif [[ $PRE_RELEASE == 'true' ]]; then
TAG="next"
fi

echo "📰 Publish Package to Registry with tag: $TAG)"
echo "📰 Publish Package to Registry with tag: $TAG"
for REGISTRY in 'GITHUB' 'NPM'
do
echo "🔒 Authenticate $REGISTRY NPM Registry"
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/03-publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
publish:
name: Publish latest package versions to GitHub Packages
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: ⬇ Checkout repo
uses: actions/checkout@v3
Expand All @@ -43,6 +41,7 @@ jobs:
RELEASE: ${{ inputs.release }}
PRE_RELEASE: ${{ inputs.preRelease }}
VALID_SEMVER_VERSION: ${{ inputs.version }}
GITHUB_COMMITISH: ${{ github.event.release.target_commitish }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GPR_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down