|
71 | 71 | - name: Run container unit tests |
72 | 72 | run: npm run test -w @repo/sandbox-container |
73 | 73 |
|
74 | | - # Prerelease publish - always runs after tests pass |
75 | | - publish-prerelease: |
76 | | - needs: [unit-tests] |
77 | | - if: ${{ github.repository_owner == 'cloudflare' }} |
78 | | - runs-on: ubuntu-latest |
79 | | - timeout-minutes: 30 |
80 | | - permissions: |
81 | | - contents: read |
82 | | - |
83 | | - steps: |
84 | | - - uses: actions/checkout@v4 |
85 | | - |
86 | | - - uses: actions/setup-node@v4 |
87 | | - with: |
88 | | - node-version: 24 |
89 | | - cache: 'npm' |
90 | | - |
91 | | - - uses: oven-sh/setup-bun@v2 |
92 | | - with: |
93 | | - bun-version: latest |
94 | | - |
95 | | - - name: Install dependencies |
96 | | - run: npm ci |
97 | | - |
98 | | - - name: Build packages |
99 | | - run: npm run build |
100 | | - |
101 | | - - name: Modify package.json version |
102 | | - run: npx tsx .github/version-script.ts |
103 | | - |
104 | | - - name: Resolve workspace dependencies |
105 | | - run: npx tsx .github/resolve-workspace-versions.ts |
106 | | - |
107 | | - - name: Set up Docker Buildx |
108 | | - uses: docker/setup-buildx-action@v3 |
109 | | - |
110 | | - - name: Login to Docker Hub |
111 | | - uses: docker/login-action@v3 |
112 | | - with: |
113 | | - username: ${{ secrets.DOCKER_HUB_USERNAME }} |
114 | | - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} |
115 | | - |
116 | | - - name: Build and cache single-arch image (for PR cache reuse) |
117 | | - uses: docker/build-push-action@v6 |
118 | | - with: |
119 | | - context: . |
120 | | - file: packages/sandbox/Dockerfile |
121 | | - platforms: linux/amd64 |
122 | | - push: false # Don't push, just cache |
123 | | - cache-from: type=gha,scope=release-amd64 |
124 | | - cache-to: type=gha,mode=max,scope=release-amd64 |
125 | | - build-args: | |
126 | | - SANDBOX_VERSION=${{ needs.unit-tests.outputs.version }} |
127 | | -
|
128 | | - - name: Build and push Docker image (beta) |
129 | | - uses: docker/build-push-action@v6 |
130 | | - with: |
131 | | - context: . |
132 | | - file: packages/sandbox/Dockerfile |
133 | | - platforms: linux/amd64,linux/arm64 |
134 | | - push: true |
135 | | - tags: cloudflare/sandbox:${{ needs.unit-tests.outputs.version }}-beta |
136 | | - cache-from: | |
137 | | - type=gha,scope=release-amd64 |
138 | | - type=gha,scope=release |
139 | | - cache-to: type=gha,mode=max,scope=release |
140 | | - build-args: | |
141 | | - SANDBOX_VERSION=${{ needs.unit-tests.outputs.version }} |
142 | | -
|
143 | | - - name: Publish to npm with beta tag |
144 | | - run: npm publish --tag beta --access public |
145 | | - env: |
146 | | - NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} |
147 | | - working-directory: packages/sandbox |
148 | | - |
149 | 74 | # Release publish - only runs if changesets exist |
150 | 75 | publish-release: |
151 | 76 | needs: [unit-tests] |
|
0 commit comments