From 23ada501a7a563d3ccba899fb6302dca59dfafc8 Mon Sep 17 00:00:00 2001 From: Genie Automagik Date: Tue, 26 May 2026 07:19:48 +0000 Subject: [PATCH] chore(workflows): consolidate npm publishing into single-source version.yml --- .github/workflows/ci.yml | 37 ----------------------------------- .github/workflows/release.yml | 33 ------------------------------- 2 files changed, 70 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89a86a1..25f7d8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,40 +35,3 @@ jobs: - name: Test run: npm test - - publish-next: - name: Publish @next - needs: [quality-gate] - if: github.event_name == 'push' && github.ref == 'refs/heads/dev' - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Build - run: npm run build - - - name: Publish to npm @next - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - if [ -z "$NODE_AUTH_TOKEN" ]; then - echo "NPM_TOKEN not set — skipping @next publish" - exit 0 - fi - echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc - LOCAL=$(jq -r '.version' package.json) - PUBLISHED=$(npm view @automagik/rlmx@next version 2>/dev/null || echo "none") - if [ "$LOCAL" = "$PUBLISHED" ]; then - echo "Version $LOCAL already published to @next — skipping" - exit 0 - fi - npm publish --tag next --access public || echo "Publish failed (version may already exist) — non-fatal" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bbb29fd..791d2df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,36 +84,3 @@ jobs: --title "${TAG}" \ --notes-file /tmp/release-notes.md fi - - - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Patch version for hotfix - if: steps.ver.outputs.hotfix == 'true' - run: | - VERSION="${{ steps.ver.outputs.version }}" - jq --arg v "$VERSION" '.version = $v' package.json > package.json.tmp - mv package.json.tmp package.json - - - name: Build - run: npm run build - - - name: Publish to npm - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - if [ -z "$NODE_AUTH_TOKEN" ]; then - echo "ERROR: NPM_TOKEN secret is not set." >&2 - exit 1 - fi - echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc - VERSION="${{ steps.ver.outputs.version }}" - if ! npm publish --access public 2>&1; then - echo "Publish failed — retagging as latest..." - npm dist-tag add "@automagik/rlmx@${VERSION}" latest - fi