Fix migration env loading when using --envPath (#37) #45
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 to npm | |
| on: | |
| release: | |
| types: [published] | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| beta: | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| registry-url: 'https://registry.npmjs.org' | |
| - uses: pnpm/action-setup@v4 | |
| - run: pnpm install | |
| - name: Set beta version | |
| run: | | |
| TIMESTAMP=$(date +%Y%m%d%H%M%S) | |
| PACKAGES=( | |
| "dataqueue:@nicnocquee/dataqueue" | |
| "react:@nicnocquee/dataqueue-react" | |
| "dashboard:@nicnocquee/dataqueue-dashboard" | |
| ) | |
| for package_entry in "${PACKAGES[@]}"; do | |
| IFS=':' read -r package_dir package_name <<< "$package_entry" | |
| PUBLISHED_VERSION=$(npm view "$package_name" version) | |
| BASE_VERSION="${PUBLISHED_VERSION%%-*}" | |
| IFS='.' read -r MAJOR MINOR _ <<< "$BASE_VERSION" | |
| NEXT_MINOR=$((MINOR + 1)) | |
| BETA_VERSION="${MAJOR}.${NEXT_MINOR}.0-beta.${TIMESTAMP}" | |
| echo "Publishing $package_name beta version: $BETA_VERSION (current: $PUBLISHED_VERSION)" | |
| cd "packages/$package_dir" && npm version "$BETA_VERSION" --no-git-tag-version && cd ../.. | |
| done | |
| - name: Build all packages | |
| run: pnpm --filter '@nicnocquee/*' run build | |
| - name: Publish beta | |
| run: | | |
| cd packages/dataqueue && npm publish --tag beta --provenance --access public && cd ../.. | |
| cd packages/react && npm publish --tag beta --provenance --access public && cd ../.. | |
| cd packages/dashboard && npm publish --tag beta --provenance --access public && cd ../.. | |
| publish: | |
| if: github.event_name == 'release' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| registry-url: 'https://registry.npmjs.org' | |
| - uses: pnpm/action-setup@v4 | |
| - run: pnpm install | |
| - name: Set version from release tag | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| echo "Publishing version: $VERSION" | |
| cd packages/dataqueue && npm version "$VERSION" --no-git-tag-version && cd ../.. | |
| cd packages/react && npm version "$VERSION" --no-git-tag-version && cd ../.. | |
| cd packages/dashboard && npm version "$VERSION" --no-git-tag-version && cd ../.. | |
| - name: Build all packages | |
| run: pnpm --filter '@nicnocquee/*' run build | |
| - name: Publish all packages | |
| run: | | |
| cd packages/dataqueue && npm publish --provenance --access public && cd ../.. | |
| cd packages/react && npm publish --provenance --access public && cd ../.. | |
| cd packages/dashboard && npm publish --provenance --access public && cd ../.. |