Skip to content

Commit

Permalink
Test release process using npm instead of yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
gpmayorga committed Dec 19, 2024
1 parent 03791fe commit c2d6d3f
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- fix_yarn_version_cli

jobs:
create-release:
Expand All @@ -14,14 +15,35 @@ jobs:
with:
fetch-depth: 2 # Need at least 2 commits to compare versions

- name: Check if version was bumped
id: version_check
- name: Check last PR labels
id: check_labels
run: |
OUTPUT=$(./.github/ci-scripts/check-version-bump.sh)
echo "::warning::$OUTPUT"
LAST_PR_NUMBER=$(gh pr list --state merged --json number --jq '.[0].number')
LABELS=$(gh pr view "$LAST_PR_NUMBER" --json labels --jq '.labels[].name')
echo "::notice::PR used to check version bump: #$LAST_PR_NUMBER"
echo "::notice::PR labels: "[${LABELS//$'\n'/,}]""
RELEASE_TYPE=$(./.github/ci-scripts/pr-label-check.sh)
if [ "$RELEASE_TYPE" == "no-release" ]; then
echo "::notice::PR is not flagged for release, skipping other steps"
else
echo "::notice::Release label found: $RELEASE_TYPE"
fi
- name: Bump version
id: bump
if: steps.check_labels.outputs.version != 'no-release'
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
if [ "${{ steps.check_labels.outputs.version }}" == "alpha" ]; then
npm version -m "[bot] New pkg version: %s" --preid=alpha prerelease
else
npm version -m "[bot] New pkg version: %s" ${{ steps.check_labels.outputs.version }}
fi
- name: Create GitHub Release
if: steps.version_check.outcome == 'success'
if: steps.bump.outcome == 'success'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down

0 comments on commit c2d6d3f

Please sign in to comment.