Skip to content

feat(upload): persist original uploaded logs to data/uploads for testing #14

feat(upload): persist original uploaded logs to data/uploads for testing

feat(upload): persist original uploaded logs to data/uploads for testing #14

Workflow file for this run

name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: read
packages: write
id-token: write
jobs:
release-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Debug npm registry and .npmrc
run: |
echo "npm registry: $(npm config get registry)"
echo "--- ~/.npmrc (if present) ---"
sed -n '1,200p' ~/.npmrc || true
echo "--- attempt HEAD on zod tarball ---"
curl -I https://registry.npmjs.org/zod/-/zod-4.3.6.tgz || true
- name: Ensure public npm registry
run: npm config set registry https://registry.npmjs.org
- name: Install dependencies (with retries)
run: |
for i in 1 2 3; do
npm ci --registry=https://registry.npmjs.org && break
echo "npm ci failed (attempt $i), retrying..."
sleep $((i * 5))
if [ $i -eq 3 ]; then
echo "npm ci failed after 3 attempts"
exit 1
fi
done
- run: npm run lint
- run: npm run test
- run: npm run build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate changelog
run: npm run generate-changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set build metadata
run: echo "BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
VERSION=${{ github.ref_name }}
GIT_SHA=${{ github.sha }}
GIT_TAG=${{ github.ref_name }}
BUILD_TIME=${{ env.BUILD_TIME }}
tags: |
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
ghcr.io/${{ github.repository }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64
- name: Generate job summary
run: |
cat << EOF >> \$GITHUB_STEP_SUMMARY
## Release Summary
**Image URL:** \`ghcr.io/${{ github.repository }}:${{ github.ref_name }}\`
**Image URL (latest):** \`ghcr.io/${{ github.repository }}:latest\`
**Version Tag:** \`${{ github.ref_name }}\`
**Docker Pull Command:**
\`\`\`bash
docker pull ghcr.io/${{ github.repository }}:${{ github.ref_name }}
\`\`\`
**Docker Pull Command (latest):**
\`\`\`bash
docker pull ghcr.io/${{ github.repository }}:latest
\`\`\`
**Changelog:** [View Release Notes](https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }})
EOF