Set TAG env var inline in publish script (#873) #135
Workflow file for this run
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: Deploy schematic-components | |
| on: | |
| push: | |
| tags: | |
| - 'schematic-components@*' | |
| - '!schematic-components@*-rc*' | |
| workflow_dispatch: | |
| jobs: | |
| lint_test: | |
| name: Lint and Test | |
| uses: ./.github/workflows/lint_test.yml | |
| with: | |
| package: schematic-components | |
| working_dir: components | |
| publish: | |
| name: NPM Publish | |
| runs-on: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/extras=s3-cache | |
| permissions: | |
| packages: write | |
| contents: read | |
| needs: [lint_test] | |
| steps: | |
| - uses: runs-on/action@v2.0.3 | |
| - uses: actions/checkout@v6 | |
| - name: Set Node.js 24.x | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.x | |
| - name: Publish | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: TAG="${{ github.ref_name }}" ./scripts/publish-package.sh | |
| update_example_app: | |
| name: Update Example App | |
| runs-on: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/extras=s3-cache | |
| needs: [publish] | |
| steps: | |
| - uses: runs-on/action@v2.0.3 | |
| - name: Checkout schematic-components | |
| uses: actions/checkout@v6 | |
| with: | |
| path: schematic-components | |
| - name: Get component version | |
| id: get_version | |
| run: | | |
| cd schematic-components/components | |
| echo "SCHEMATIC_COMPONENTS_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: Checkout example app | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: schematichq/schematic-next-example | |
| path: schematic-next-example | |
| token: ${{ secrets.DEPENDENT_UPDATE_PAT }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.x | |
| - name: Update example app dependencies | |
| run: | | |
| cd schematic-next-example | |
| yarn add @schematichq/schematic-components@${{ steps.get_version.outputs.SCHEMATIC_COMPONENTS_VERSION }} | |
| - name: Check for changes | |
| id: check_changes | |
| run: | | |
| cd schematic-next-example | |
| git diff --exit-code || echo "HAS_CHANGES=true" >> $GITHUB_OUTPUT | |
| - name: Create Pull Request | |
| if: steps.check_changes.outputs.HAS_CHANGES == 'true' | |
| uses: peter-evans/create-pull-request@v8.1.0 | |
| with: | |
| token: ${{ secrets.DEPENDENT_UPDATE_PAT }} | |
| commit-message: Update @schematichq/schematic-components to ${{ steps.get_version.outputs.SCHEMATIC_COMPONENTS_VERSION }} | |
| title: Update @schematichq/schematic-components to ${{ steps.get_version.outputs.SCHEMATIC_COMPONENTS_VERSION }} | |
| body: | | |
| This PR updates the @schematichq/schematic-components package to version ${{ steps.get_version.outputs.SCHEMATIC_COMPONENTS_VERSION }}. | |
| This update was automatically created by the schematic-components deployment process. | |
| branch: schematic-components-${{ steps.get_version.outputs.SCHEMATIC_COMPONENTS_VERSION }} | |
| base: main | |
| delete-branch: true | |
| path: schematic-next-example | |
| notify_slack: | |
| name: Notify Slack | |
| runs-on: runs-on=${{ github.run_id }}/runner=1cpu-linux-arm64 | |
| needs: [publish] | |
| steps: | |
| - uses: rtCamp/action-slack-notify@v2.3.3 | |
| env: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| SLACK_TITLE: Updated schematic-components | |
| SLACK_ICON: https://schematic-public-assets.s3.amazonaws.com/logos/logo-transparent.png |