Skip to content

Commit

Permalink
chore: update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
stalniy committed Nov 21, 2023
1 parent 9d7ae6f commit af434c7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ name: Release packages
on:
pull_request:
types: [closed, labeled]
# workflow_dispatch:
# inputs:
# packagePath:
# description: 'Package path'
# required: true

jobs:
release:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'released')
if: ${{ !github.event.pull_request || github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'released') }}
steps:
- name: Check out code
uses: actions/checkout@v3
Expand Down Expand Up @@ -42,6 +47,8 @@ jobs:
for path in $changed_packages; do
pnpm_options="${pnpm_options} --filter ./${path}"
done
echo "running: pnpm run -r $pnpm_options release" >> $GITHUB_STEP_SUMMARY
pnpm run -r $pnpm_options release
released_packages=()
Expand All @@ -50,4 +57,9 @@ jobs:
package_version=$(grep '"version":' $path | cut -d : -f 2 | cut -d '"' -f 2)
released_packages[${#released_packages[@]}]="${package_name}@${package_version}"
done
gh pr comment "${{ github.event.pull_request.number }}" --body "🚀 Released in ${released_packages[@]}"
if [ "${github.event.pull_request.number}" != "" ]; then
gh pr comment "${{ github.event.pull_request.number }}" --body "🚀 Released in ${released_packages[@]}"
fi
echo "🚀 Released in ${released_packages[@]}" >> $GITHUB_STEP_SUMMARY

0 comments on commit af434c7

Please sign in to comment.