npm install -D menulis 5 paket semantic-release + 333 dep ke devDependencies package.json — padahal repo pakai bun.lock. prepareCmd lalu jalankan 'bun install --frozen-lockfile' yang melihat package.json 'terpolusi' (1561 paket vs 30 di bun.lock) -> 'lockfile had changes, but lockfile is frozen' -> Release selalu gagal. Fix: install semantic-release ke prefix terisolasi /tmp/sr-tools + tambah ke GITHUB_PATH, jalankan 'semantic-release' langsung (bukan npx yang pakai proses -D). prepareCmd (--frozen-lockfile) dibiarkan benar: bun.lock version-agnostic, verifikasi lokal lolos.
58 lines
1.2 KiB
YAML
58 lines
1.2 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: write
|
|
issues: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
|
|
- name: Install
|
|
run: bun install --frozen-lockfile
|
|
|
|
- name: Type-check
|
|
run: bun run check
|
|
|
|
- name: Test
|
|
run: bun test
|
|
|
|
release:
|
|
name: Semantic Release
|
|
needs: [test]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
|
|
- name: Install semantic-release (isolated prefix — do NOT touch repo package.json)
|
|
run: |
|
|
mkdir -p /tmp/sr-tools
|
|
npm install --prefix /tmp/sr-tools \
|
|
semantic-release \
|
|
@semantic-release/exec \
|
|
@semantic-release/git \
|
|
@semantic-release/changelog \
|
|
@semantic-release/github
|
|
echo "/tmp/sr-tools/node_modules/.bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Run semantic-release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: semantic-release
|