name: Release on: push: tags: - "v*" workflow_dispatch: permissions: contents: write jobs: release: runs-on: docker container: image: docker.io/library/node:22 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install dependencies run: npm ci - name: Build run: npm run build - name: Test run: npm test - name: Publish to npm env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | # Set authToken explicitly — actions/setup-node was the only consumer # of registry-url + NODE_AUTH_TOKEN, and we dropped it for Forgejo # compat. The literal npmjs registry stays the same. cat > ~/.npmrc </dev/null || echo "") if [ -n "$prev" ]; then notes=$(git log --pretty=format:'- %s' "${prev}..${TAG}") else notes=$(git log --pretty=format:'- %s' "${TAG}") fi body=$(jq -n --arg t "$TAG" --arg n "$notes" \ '{tag_name:$t, name:$t, body:$n, draft:false, prerelease:false}') curl -sSf -X POST "$FORGEJO_API/repos/$REPO/releases" \ -H "Authorization: token $FORGEJO_TOKEN" \ -H "Content-Type: application/json" \ -d "$body" >/dev/null || \ echo "Release may already exist for $TAG"