clean up subpackage pyproject.toml dependencies (#6377) #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto-release internal packages | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "packages/reflex-components-internal/**" | |
| - "packages/reflex-site-shared/**" | |
| - ".github/workflows/auto_release_internal.yml" | |
| workflow_dispatch: | |
| inputs: | |
| package: | |
| description: "Package to release" | |
| required: true | |
| type: choice | |
| options: | |
| - reflex-components-internal | |
| - reflex-site-shared | |
| permissions: | |
| contents: write | |
| actions: write | |
| jobs: | |
| detect: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| packages: ${{ steps.detect.outputs.packages }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - id: detect | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| DISPATCH_PACKAGE: ${{ inputs.package }} | |
| run: | | |
| set -euo pipefail | |
| if [ "$EVENT_NAME" = "workflow_dispatch" ]; then | |
| printf 'packages=["%s"]\n' "$DISPATCH_PACKAGE" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| PACKAGES=() | |
| for pkg in reflex-components-internal reflex-site-shared; do | |
| if git diff --name-only HEAD~1 HEAD -- "packages/$pkg/" | grep -q .; then | |
| PACKAGES+=("\"$pkg\"") | |
| fi | |
| done | |
| JOINED=$(IFS=,; echo "${PACKAGES[*]:-}") | |
| echo "packages=[$JOINED]" >> "$GITHUB_OUTPUT" | |
| release: | |
| needs: detect | |
| if: needs.detect.outputs.packages != '[]' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| package: ${{ fromJson(needs.detect.outputs.packages) }} | |
| fail-fast: false | |
| concurrency: | |
| group: release-${{ matrix.package }} | |
| cancel-in-progress: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-tags: true | |
| fetch-depth: 0 | |
| - name: Compute next version | |
| id: version | |
| env: | |
| PKG: ${{ matrix.package }} | |
| run: | | |
| set -euo pipefail | |
| LATEST=$(git tag -l "${PKG}-v*" | sed "s/^${PKG}-v//" | sort -V | tail -1) | |
| if [ -z "$LATEST" ]; then | |
| NEXT="0.0.1" | |
| else | |
| IFS='.' read -r MAJOR MINOR PATCH <<< "$LATEST" | |
| NEXT="${MAJOR}.${MINOR}.$((PATCH + 1))" | |
| fi | |
| echo "version=$NEXT" >> "$GITHUB_OUTPUT" | |
| echo "tag=${PKG}-v${NEXT}" >> "$GITHUB_OUTPUT" | |
| - name: Create GitHub release (not marked latest) | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG: ${{ steps.version.outputs.tag }} | |
| PKG: ${{ matrix.package }} | |
| VERSION: ${{ steps.version.outputs.version }} | |
| run: | | |
| set -euo pipefail | |
| gh release create "$TAG" \ | |
| --title "$PKG@$VERSION" \ | |
| --notes "Automated release for $PKG v$VERSION" \ | |
| --target "$GITHUB_SHA" \ | |
| --latest=false | |
| - name: Trigger publish workflow | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG: ${{ steps.version.outputs.tag }} | |
| run: | | |
| set -euo pipefail | |
| gh workflow run publish.yml -f tag="$TAG" |