|
| 1 | +name: Release Nightly |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + # 00:07 AM Beijing Time, offset an odd number to avoid cron jobs firing off at the same time |
| 7 | + - cron: '7 16 * * *' |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: Release Nightly |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + target: |
| 15 | + - x86_64-unknown-linux-gnu |
| 16 | + - aarch64-unknown-linux-gnu |
| 17 | + - x86_64-unknown-linux-musl |
| 18 | + - aarch64-unknown-linux-musl |
| 19 | + - i686-pc-windows-msvc |
| 20 | + - x86_64-pc-windows-msvc |
| 21 | + - aarch64-pc-windows-msvc |
| 22 | + - x86_64-apple-darwin |
| 23 | + - aarch64-apple-darwin |
| 24 | + uses: ./.github/workflows/reusable-build.yml |
| 25 | + with: |
| 26 | + target: ${{ matrix.target }} |
| 27 | + docker: true |
| 28 | + tests: true |
| 29 | + |
| 30 | + release: |
| 31 | + name: Nightly |
| 32 | + permissions: |
| 33 | + contents: write |
| 34 | + runs-on: ubuntu-latest |
| 35 | + needs: build |
| 36 | + steps: |
| 37 | + - name: Checkout Repo |
| 38 | + uses: actions/checkout@v3 |
| 39 | + with: |
| 40 | + # This makes Actions fetch only one branch to release |
| 41 | + fetch-depth: 1 |
| 42 | + |
| 43 | + - name: Pnpm Cache |
| 44 | + uses: ./.github/actions/pnpm-cache |
| 45 | + |
| 46 | + - name: Download artifacts |
| 47 | + uses: actions/download-artifact@v3 |
| 48 | + with: |
| 49 | + path: artifacts |
| 50 | + |
| 51 | + - name: Build node packages |
| 52 | + run: pnpm run build:js |
| 53 | + |
| 54 | + - name: Move artifacts |
| 55 | + run: node scripts/build-npm.js |
| 56 | + |
| 57 | + - name: Show binding packages |
| 58 | + run: ls -R npm |
| 59 | + |
| 60 | + - name: Link optional dependencies |
| 61 | + run: pnpm install --no-frozen-lockfile |
| 62 | + |
| 63 | + - name: Prevent changeset crashing on empty changesets |
| 64 | + shell: bash |
| 65 | + run: | |
| 66 | + pnpm run changeset add --empty |
| 67 | + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| 68 | + git config user.name "github-actions[bot]" |
| 69 | + git add . |
| 70 | + git commit -m "chore: bump nightly" |
| 71 | +
|
| 72 | + - name: Release |
| 73 | + uses: web-infra-dev/actions@v2 |
| 74 | + with: |
| 75 | + version: "canary" |
| 76 | + npmTag: "nightly" |
| 77 | + type: "release" |
| 78 | + branch: "" |
| 79 | + tools: "changeset" |
| 80 | + env: |
| 81 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 82 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 83 | + REPOSITORY: ${{ github.repository }} |
| 84 | + REF: ${{ github.ref }} |
| 85 | + ONLY_RELEASE_TAG: true |
0 commit comments