Bump 1.16.2 #145
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: Release | |
| on: | |
| push: | |
| branches: [main, release-**] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| uses: ./.github/workflows/test.yml | |
| release: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@v1 | |
| with: | |
| deno-version: v2.6 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 11.1.3 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm build | |
| - name: Publish snapshot | |
| if: github.ref == 'refs/heads/main' | |
| env: | |
| # Run the prepublishOnly verify's turbo tasks one at a time. api-extractor | |
| # intermittently fails ("Internal Error: Unable to determine module for | |
| # dist/<entry>.d.ts") when several api-extractor/build tasks run in parallel. | |
| TURBO_CONCURRENCY: "1" | |
| run: | | |
| # We're using 0.0.0 to avoid this version to be higher than released versions. | |
| # To use it: | |
| # "@restatedev/restate-sdk": "^0.0.0-SNAPSHOT" | |
| VERSION="0.0.0-SNAPSHOT-$(date '+%Y%m%d%H%M%S')" | |
| # Update all lib package versions using jq | |
| for pkg in packages/libs/*/package.json; do | |
| jq --arg ver "$VERSION" '.version = $ver' "$pkg" > "$pkg.tmp" && mv "$pkg.tmp" "$pkg" | |
| done | |
| # Update workspace protocol dependencies to use the snapshot version | |
| pnpm install --no-frozen-lockfile | |
| # We use dist-tag dev for the snapshot releases, see https://docs.npmjs.com/cli/v9/commands/npm-dist-tag for more info | |
| # A snapshot MUST not be published with latest tag (omitting --tag defaults to latest) to avoid users to install snapshot releases | |
| # when using pnpm install | |
| pnpm --filter "./packages/libs/**" publish --tag dev --access public --no-git-checks --provenance | |
| git checkout . | |
| - name: Check for new version | |
| id: check | |
| run: | | |
| git fetch --tags | |
| for package in packages/libs/*/package.json; do | |
| if [ -f "$package" ]; then | |
| NAME=$(jq -r '.name' "$package") | |
| VERSION=$(jq -r '.version' "$package") | |
| PRIVATE=$(jq -r '.private // false' "$package") | |
| if [ "$PRIVATE" = "false" ]; then | |
| if ! git rev-parse "v$VERSION" >/dev/null 2>&1; then | |
| echo "New version detected: $NAME@$VERSION" | |
| echo "create_release=true" >> "$GITHUB_OUTPUT" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| # Pre-release versions (e.g. 1.2.3-rc.1, 1.2.3-alpha.0) MUST NOT be published | |
| # with the latest npm dist-tag (omitting --tag defaults to latest), otherwise | |
| # users would get the pre-release on a plain install. | |
| # We use the pre-release identifier (rc, alpha, beta, ...) as the dist-tag. | |
| if [[ "$VERSION" == *-* ]]; then | |
| PRERELEASE_ID="${VERSION#*-}" | |
| PRERELEASE_ID="${PRERELEASE_ID%%.*}" | |
| echo "Pre-release detected, using npm dist-tag: $PRERELEASE_ID" | |
| echo "prerelease=true" >> "$GITHUB_OUTPUT" | |
| echo "npm_tag=$PRERELEASE_ID" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "prerelease=false" >> "$GITHUB_OUTPUT" | |
| echo "npm_tag=latest" >> "$GITHUB_OUTPUT" | |
| fi | |
| break | |
| fi | |
| fi | |
| fi | |
| done | |
| - name: Create and Push Tag | |
| if: steps.check.outputs.create_release == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git tag "v${{ steps.check.outputs.version }}" | |
| git push origin "v${{ steps.check.outputs.version }}" | |
| - name: Create Release | |
| if: steps.check.outputs.create_release == 'true' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| EXTRA_FLAGS="" | |
| if [ "${{ steps.check.outputs.prerelease }}" = "true" ]; then | |
| EXTRA_FLAGS="--prerelease" | |
| fi | |
| gh release create "v${{ steps.check.outputs.version }}" \ | |
| --title "Release v${{ steps.check.outputs.version }}" \ | |
| --generate-notes \ | |
| $EXTRA_FLAGS | |
| - name: Publish release to npm | |
| if: steps.check.outputs.create_release == 'true' | |
| env: | |
| TURBO_CONCURRENCY: "1" # serialize the prepublishOnly verify (see "Publish snapshot") | |
| run: pnpm -r --filter='./packages/libs/**' publish --tag "${{ steps.check.outputs.npm_tag }}" --access public --no-git-checks --provenance |