|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +concurrency: ${{ github.workflow }}-${{ github.ref }} |
| 9 | + |
| 10 | +jobs: |
| 11 | + release: |
| 12 | + name: Release |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Checkout Repo |
| 16 | + uses: actions/checkout@v4 |
| 17 | + - name: Setup Node.js |
| 18 | + uses: actions/setup-node@v4 |
| 19 | + with: |
| 20 | + node-version-file: ".nvmrc" |
| 21 | + - uses: pnpm/action-setup@v2 |
| 22 | + name: Install pnpm |
| 23 | + with: |
| 24 | + # Pnpm 9.4 introduces this https://github.com/pnpm/pnpm/pull/7633 |
| 25 | + # which causes workspace:^1.2.0 to be converted to 1.2.0^1.2.0 |
| 26 | + version: 9.3 |
| 27 | + run_install: false |
| 28 | + - name: Get pnpm store directory |
| 29 | + shell: bash |
| 30 | + run: | |
| 31 | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
| 32 | + - uses: actions/cache@v3 |
| 33 | + name: Setup pnpm cache |
| 34 | + with: |
| 35 | + path: ${{ env.STORE_PATH }} |
| 36 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 37 | + restore-keys: | |
| 38 | + ${{ runner.os }}-pnpm-store- |
| 39 | + - name: Install dependencies |
| 40 | + run: pnpm install |
| 41 | + |
| 42 | + - name: Install sha3sum |
| 43 | + run: | |
| 44 | + sudo apt-get update |
| 45 | + sudo apt-get install -y libdigest-sha3-perl |
| 46 | +
|
| 47 | + - name: Setup Emscripten |
| 48 | + uses: mymindstorm/setup-emsdk@v14 |
| 49 | + with: |
| 50 | + version: "latest" |
| 51 | + actions-cache-folder: "emsdk-cache" |
| 52 | + |
| 53 | + - name: Create Release Pull Request or Publish to npm |
| 54 | + id: changesets |
| 55 | + uses: changesets/action@v1 |
| 56 | + with: |
| 57 | + # Update the monorepo lockfile after versioning |
| 58 | + version: pnpm changeset:version |
| 59 | + # This expects you to have a script called release which does a build for your packages and calls changeset publish |
| 60 | + publish: pnpm release |
| 61 | + env: |
| 62 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 63 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments