bump #38
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: typescript | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "cli/**" | |
| - "sdk/**" | |
| jobs: | |
| publish-cli: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| defaults: | |
| run: | |
| working-directory: ./cli | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install pnpm | |
| run: npm install -g pnpm@8 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build and Publish SDK | |
| run: | | |
| VERSION=$(jq '.version' package.json) | |
| CURRENT_NPM_VERSION=$(pnpm view @hatchet-dev/typescript-sdk version) | |
| if [[ "$VERSION" == "$CURRENT_NPM_VERSION" ]]; then | |
| echo "Version has not changed. Skipping publish." | |
| exit 0 | |
| fi | |
| ## If the version contains `alpha`, it's an alpha version | |
| ## and we should tag it as such.= | |
| if [[ "$VERSION" == *alpha* ]]; then | |
| pnpm publish:ci:alpha | |
| else | |
| pnpm publish:ci | |
| fi | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| publish-sdk: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| defaults: | |
| run: | |
| working-directory: ./sdk | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install pnpm | |
| run: npm install -g pnpm@8 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build and Publish SDK | |
| run: | | |
| VERSION=$(jq '.version' package.json) | |
| CURRENT_NPM_VERSION=$(pnpm view @hatchet-dev/typescript-sdk version) | |
| if [[ "$VERSION" == "$CURRENT_NPM_VERSION" ]]; then | |
| echo "Version has not changed. Skipping publish." | |
| exit 0 | |
| fi | |
| ## If the version contains `alpha`, it's an alpha version | |
| ## and we should tag it as such.= | |
| if [[ "$VERSION" == *alpha* ]]; then | |
| pnpm publish:ci:alpha | |
| else | |
| pnpm publish:ci | |
| fi | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |