v0.0.128 #16
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: Publish Packages to GitHub Registry | |
| on: | |
| release: | |
| types: [created] | |
| workflow_dispatch: | |
| # Manual trigger is always a dry run - actual publishing requires a release | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@moises-ai' | |
| - name: Verify scope transformation | |
| run: node scripts/verify-scope.js | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build all packages | |
| run: npm run build | |
| - name: Run tests | |
| run: npm test | |
| - name: Dry run (manual trigger) | |
| if: ${{ github.event_name == 'workflow_dispatch' }} | |
| run: | | |
| echo "::notice::This is a DRY RUN - no packages will be published" | |
| echo "To publish packages, create a GitHub Release" | |
| echo "" | |
| echo "Packages that would be published:" | |
| npx lerna ls --no-private --json | jq -r '.[] | " - \(.name)@\(.version)"' | |
| - name: Publish packages (release trigger) | |
| if: ${{ github.event_name == 'release' }} | |
| run: npx lerna publish from-package --yes --no-private --loglevel verbose | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Summary | |
| if: success() | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "## Dry Run Complete" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "This was a **dry run** - no packages were actually published." >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "To publish, create a GitHub Release using the \`@moises-ai/studio-sdk\` version as the tag." >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Packages that would be published:" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "## Published Packages" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "The following packages were published to GitHub Package Registry:" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| npx lerna ls --no-private --json 2>/dev/null | jq -r '.[] | "- \(.name)@\(.version)"' >> $GITHUB_STEP_SUMMARY |