Skip to content

Commit 6ae4efe

Browse files
committed
fix(docker): update gateway download URL and optimize npm install command
1 parent b97da51 commit 6ae4efe

2 files changed

Lines changed: 44 additions & 24 deletions

File tree

.github/workflows/release-sdk.yml

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,17 @@ jobs:
4242
recover-stale-releases:
4343
name: Recover Stale Releases
4444
runs-on: ubuntu-latest
45-
if: github.event_name == 'push'
45+
# Runs on every trigger but steps are conditioned on push events.
46+
# This ensures the job always succeeds (never "skipped"), so downstream
47+
# jobs can depend on it without if: always() — which breaks output propagation.
4648
steps:
4749
- uses: actions/checkout@v4
50+
if: github.event_name == 'push'
4851
with:
4952
fetch-depth: 0
5053

5154
- name: Create missing manifest tags and relabel stale PRs
55+
if: github.event_name == 'push'
5256
env:
5357
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5458
run: |
@@ -106,7 +110,7 @@ jobs:
106110
name: Release Please
107111
runs-on: ubuntu-latest
108112
needs: recover-stale-releases
109-
if: always() # run even if recover-stale-releases was skipped (workflow_dispatch)
113+
if: ${{ !cancelled() }}
110114
outputs:
111115
releases_created: ${{ steps.resolve.outputs.releases_created }}
112116
paths_released: ${{ steps.resolve.outputs.paths_released }}
@@ -148,22 +152,37 @@ jobs:
148152
- name: Resolve outputs
149153
id: resolve
150154
run: |
155+
set -euo pipefail
156+
151157
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
152158
GATEWAY_TAG="${{ inputs.gateway_tag }}"
153-
GATEWAY_RELEASE_CREATED=$([[ -n "$GATEWAY_TAG" ]] && echo "true" || echo "")
154-
NPM_PUBLISH=$([[ "${{ inputs.republish_npm }}" == "true" ]] && echo "true" || echo "")
155-
RELEASES_CREATED=$([[ -n "$GATEWAY_RELEASE_CREATED" || -n "$NPM_PUBLISH" ]] && echo "true" || echo "")
156-
echo "releases_created=${RELEASES_CREATED}" >> "$GITHUB_OUTPUT"
157-
echo "paths_released=" >> "$GITHUB_OUTPUT"
158-
echo "gateway_release_created=${GATEWAY_RELEASE_CREATED}" >> "$GITHUB_OUTPUT"
159-
echo "gateway_tag_name=${GATEWAY_TAG}" >> "$GITHUB_OUTPUT"
160-
echo "npm_publish=${NPM_PUBLISH}" >> "$GITHUB_OUTPUT"
159+
if [[ -n "$GATEWAY_TAG" ]]; then GATEWAY_RELEASE_CREATED="true"; else GATEWAY_RELEASE_CREATED=""; fi
160+
if [[ "${{ inputs.republish_npm }}" == "true" ]]; then NPM_PUBLISH="true"; else NPM_PUBLISH=""; fi
161+
if [[ -n "$GATEWAY_RELEASE_CREATED" || -n "$NPM_PUBLISH" ]]; then RELEASES_CREATED="true"; else RELEASES_CREATED=""; fi
162+
163+
{
164+
echo "releases_created=${RELEASES_CREATED}"
165+
echo "paths_released="
166+
echo "gateway_release_created=${GATEWAY_RELEASE_CREATED}"
167+
echo "gateway_tag_name=${GATEWAY_TAG}"
168+
echo "npm_publish=${NPM_PUBLISH}"
169+
} >> "$GITHUB_OUTPUT"
170+
171+
echo "::notice::workflow_dispatch — npm_publish=${NPM_PUBLISH}, gateway_release_created=${GATEWAY_RELEASE_CREATED}, gateway_tag=${GATEWAY_TAG}"
161172
else
162-
echo "releases_created=${{ steps.release.outputs.releases_created }}" >> "$GITHUB_OUTPUT"
163-
echo "paths_released=${{ steps.release.outputs.paths_released }}" >> "$GITHUB_OUTPUT"
164-
echo "gateway_release_created=${{ steps.release.outputs['gateway--release_created'] }}" >> "$GITHUB_OUTPUT"
165-
echo "gateway_tag_name=${{ steps.release.outputs['gateway--tag_name'] }}" >> "$GITHUB_OUTPUT"
166-
echo "npm_publish=${{ steps.release.outputs.releases_created }}" >> "$GITHUB_OUTPUT"
173+
# All npm packages use linked-versions, so sdk is representative.
174+
# No fallback to releases_created — that includes gateway-only releases.
175+
NPM_PUBLISH="${{ steps.release.outputs['sdk--release_created'] }}"
176+
177+
{
178+
echo "releases_created=${{ steps.release.outputs.releases_created }}"
179+
echo "paths_released=${{ steps.release.outputs.paths_released }}"
180+
echo "gateway_release_created=${{ steps.release.outputs['gateway--release_created'] }}"
181+
echo "gateway_tag_name=${{ steps.release.outputs['gateway--tag_name'] }}"
182+
echo "npm_publish=${NPM_PUBLISH}"
183+
} >> "$GITHUB_OUTPUT"
184+
185+
echo "::notice::push — releases_created=${{ steps.release.outputs.releases_created }}, npm_publish=${NPM_PUBLISH}, gateway=${{ steps.release.outputs['gateway--release_created'] }}"
167186
fi
168187
169188
publish-npm:
@@ -197,7 +216,7 @@ jobs:
197216
run: |
198217
V=$(node -p "require('./package.json').version")
199218
PUBLISHED=$(npm view @rep-protocol/sdk@${V} version 2>/dev/null || true)
200-
if [ "$PUBLISHED" = "$V" ]; then echo "sdk@${V} already published, skipping."; else npm publish --provenance --access public; fi
219+
if [ "$PUBLISHED" = "$V" ]; then echo "sdk@${V} already published, skipping."; else pnpm publish --provenance --access public --no-git-checks; fi
201220
env:
202221
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
203222

@@ -206,7 +225,7 @@ jobs:
206225
run: |
207226
V=$(node -p "require('./package.json').version")
208227
PUBLISHED=$(npm view @rep-protocol/cli@${V} version 2>/dev/null || true)
209-
if [ "$PUBLISHED" = "$V" ]; then echo "cli@${V} already published, skipping."; else npm publish --provenance --access public; fi
228+
if [ "$PUBLISHED" = "$V" ]; then echo "cli@${V} already published, skipping."; else pnpm publish --provenance --access public --no-git-checks; fi
210229
env:
211230
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
212231

@@ -215,7 +234,7 @@ jobs:
215234
run: |
216235
V=$(node -p "require('./package.json').version")
217236
PUBLISHED=$(npm view @rep-protocol/codemod@${V} version 2>/dev/null || true)
218-
if [ "$PUBLISHED" = "$V" ]; then echo "codemod@${V} already published, skipping."; else npm publish --provenance --access public; fi
237+
if [ "$PUBLISHED" = "$V" ]; then echo "codemod@${V} already published, skipping."; else pnpm publish --provenance --access public --no-git-checks; fi
219238
env:
220239
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
221240

@@ -224,7 +243,7 @@ jobs:
224243
run: |
225244
V=$(node -p "require('./package.json').version")
226245
PUBLISHED=$(npm view @rep-protocol/react@${V} version 2>/dev/null || true)
227-
if [ "$PUBLISHED" = "$V" ]; then echo "react@${V} already published, skipping."; else npm publish --provenance --access public; fi
246+
if [ "$PUBLISHED" = "$V" ]; then echo "react@${V} already published, skipping."; else pnpm publish --provenance --access public --no-git-checks; fi
228247
env:
229248
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
230249

@@ -233,7 +252,7 @@ jobs:
233252
run: |
234253
V=$(node -p "require('./package.json').version")
235254
PUBLISHED=$(npm view @rep-protocol/vue@${V} version 2>/dev/null || true)
236-
if [ "$PUBLISHED" = "$V" ]; then echo "vue@${V} already published, skipping."; else npm publish --provenance --access public; fi
255+
if [ "$PUBLISHED" = "$V" ]; then echo "vue@${V} already published, skipping."; else pnpm publish --provenance --access public --no-git-checks; fi
237256
env:
238257
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
239258

@@ -242,7 +261,7 @@ jobs:
242261
run: |
243262
V=$(node -p "require('./package.json').version")
244263
PUBLISHED=$(npm view @rep-protocol/svelte@${V} version 2>/dev/null || true)
245-
if [ "$PUBLISHED" = "$V" ]; then echo "svelte@${V} already published, skipping."; else npm publish --provenance --access public; fi
264+
if [ "$PUBLISHED" = "$V" ]; then echo "svelte@${V} already published, skipping."; else pnpm publish --provenance --access public --no-git-checks; fi
246265
env:
247266
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
248267

examples/todo-react/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ARG TARGETARCH=amd64
2323
RUN apk add --no-cache curl ca-certificates && \
2424
ARCHIVE="rep-gateway_${GATEWAY_VERSION}_linux_${TARGETARCH}.tar.gz" && \
2525
curl -fsSL \
26-
"https://github.com/RuachTech/rep/releases/download/gateway/v${GATEWAY_VERSION}/${ARCHIVE}" \
26+
"https://github.com/RuachTech/rep/releases/download/v${GATEWAY_VERSION}/${ARCHIVE}" \
2727
-o /tmp/gateway.tar.gz && \
2828
tar -xzf /tmp/gateway.tar.gz -C /tmp && \
2929
mv /tmp/rep-gateway /rep-gateway && \
@@ -35,8 +35,9 @@ FROM node:20-alpine AS app
3535
WORKDIR /app
3636

3737
# Copy package files and install dependencies from npm registry.
38-
COPY package.json package-lock.json* ./
39-
RUN npm install
38+
COPY package.json ./
39+
# install on main deps only,
40+
RUN npm install --omit=dev
4041

4142
# Copy source and build.
4243
COPY . .

0 commit comments

Comments
 (0)