From e2967cae64453167bc43c109208c79c789c5a258 Mon Sep 17 00:00:00 2001 From: Satyanarayana Vuppala Date: Sun, 8 Nov 2026 17:58:06 +0000 Subject: [PATCH 1/3] chore: bump version to 0.3.1 PyPI already has 0.3.0, so this patch ships the dashboard and README work that landed after that release. Co-authored-by: Cursor --- src/secfoo/__about__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/secfoo/__about__.py b/src/secfoo/__about__.py index 493f7415..260c070a 100644 --- a/src/secfoo/__about__.py +++ b/src/secfoo/__about__.py @@ -1 +1 @@ -__version__ = "0.3.0" +__version__ = "0.3.1" From d41fe05311938bece1969d4c5ea35122c149c650 Mon Sep 17 00:00:00 2001 From: Satyanarayana Vuppala Date: Sun, 8 Nov 2026 18:26:44 +0000 Subject: [PATCH 2/3] ci: build darwin-arm64 releases on macos-15 macos-14 runners are no longer available, which blocked the npm publish of the Apple Silicon binary. Co-authored-by: Cursor --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6136bca..977ba52e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,7 @@ jobs: fail-fast: false matrix: include: - - os: macos-14 + - os: macos-15 name: darwin-arm64 - os: macos-15-intel name: darwin-x64 From 5715b0e82dd2ce4299096302b00718ea188d3c3e Mon Sep 17 00:00:00 2001 From: Satyanarayana Vuppala Date: Sun, 15 Nov 2026 14:14:15 +0000 Subject: [PATCH 3/3] ci: publish npm without waiting on GitHub Release The v0.3.1 run built every binary and uploaded PyPI, then skipped npm because the GitHub Release artifact download failed. npm now depends only on the binaries, already-published versions are skipped, and GHCR pushes to this repo's owner so the public release does not target rakfortltd. Co-authored-by: Cursor --- .github/workflows/release.yml | 74 ++++++++++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 977ba52e..df3629dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,12 @@ name: Release # Required repo secrets (Settings -> Secrets and variables -> Actions): # PYPI_API_TOKEN - PyPI account -> API tokens # NPM_TOKEN - npmjs.com account -> Access Tokens -> Automation -# GITHUB_TOKEN (GHCR push) is provided automatically, no setup needed. +# GITHUB_TOKEN (GHCR push) is provided automatically, no setup needed. It +# can only push under this repo's own owner, so the image is +# ghcr.io//secfoo (ghcr.io/secfoo-com/secfoo on the public repo). +# +# Every publish step skips a version that's already out, so a run that +# failed halfway can simply be re-run for the same tag. on: workflow_dispatch: @@ -96,7 +101,16 @@ jobs: permissions: contents: write steps: - - uses: actions/download-artifact@v4 + # The binaries are 100+ MB each and this download has failed + # transiently before ("Artifact download failed after 5 retries"), + # so give it one more attempt before failing the release. + - id: download + uses: actions/download-artifact@v4 + continue-on-error: true + with: + path: artifacts + - if: steps.download.outcome == 'failure' + uses: actions/download-artifact@v4 with: path: artifacts - name: Flatten artifacts and compute checksums @@ -126,14 +140,18 @@ jobs: - env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - run: twine upload dist/*.tar.gz dist/*.whl + run: twine upload --skip-existing dist/*.tar.gz dist/*.whl publish-npm: name: Publish npm packages - needs: [check-version, release] + # Needs only the binaries, not the GitHub Release, so a flaky release + # upload doesn't also block npm. + needs: [check-version, build-binaries] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + ref: ${{ inputs.tag }} - uses: actions/download-artifact@v4 with: path: artifacts @@ -147,6 +165,19 @@ jobs: VERSION: ${{ needs.check-version.outputs.version }} run: | set -euo pipefail + if [ -z "${NODE_AUTH_TOKEN:-}" ]; then + echo "::error::NPM_TOKEN secret is not set (Settings -> Secrets and variables -> Actions)." + exit 1 + fi + publish() { + local dir="$1" name + name=$(node -p "require('./$dir/package.json').name") + if npm view "$name@$VERSION" version >/dev/null 2>&1; then + echo "$name@$VERSION is already on npm, skipping" + else + npm publish --access public "$dir" + fi + } declare -A DIRS=( [darwin-arm64]=npm/secfoo-darwin-arm64 [darwin-x64]=npm/secfoo-darwin-x64 @@ -164,10 +195,10 @@ jobs: chmod +x "$pkgdir/bin/secfoo" fi npm version "$VERSION" --no-git-tag-version --prefix "$pkgdir" --allow-same-version - npm publish --access public "$pkgdir" + publish "$pkgdir" done npm version "$VERSION" --no-git-tag-version --prefix npm/secfoo --allow-same-version - npm publish --access public npm/secfoo + publish npm/secfoo publish-docker: name: Publish Docker image (GHCR) @@ -185,12 +216,37 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Image name (GHCR needs a lowercase owner) + id: image + run: echo "name=ghcr.io/$(echo "$GITHUB_REPOSITORY_OWNER" | tr '[:upper:]' '[:lower:]')/secfoo" >> "$GITHUB_OUTPUT" - name: Wait for the new version to be installable from PyPI - run: sleep 60 + env: + VERSION: ${{ needs.check-version.outputs.version }} + run: | + for _ in $(seq 1 40); do + if pip download --no-deps --quiet --dest /tmp/pypi-check "secfoo==$VERSION" 2>/dev/null; then + exit 0 + fi + sleep 15 + done + echo "::error::secfoo==$VERSION is still not installable from PyPI after 10 minutes." + exit 1 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 - uses: docker/build-push-action@v6 with: context: . push: true + platforms: linux/amd64,linux/arm64 + build-args: | + SECFOO_VERSION=${{ needs.check-version.outputs.version }} + # The source label links the package to this repo, which is what + # lists it under the repo's "Packages" sidebar. + labels: | + org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} + org.opencontainers.image.version=${{ needs.check-version.outputs.version }} + org.opencontainers.image.licenses=MIT + org.opencontainers.image.description=Secfoo CLI: context-based security assessment with your coding agent tags: | - ghcr.io/rakfortltd/secfoo:${{ needs.check-version.outputs.version }} - ghcr.io/rakfortltd/secfoo:latest + ${{ steps.image.outputs.name }}:${{ needs.check-version.outputs.version }} + ${{ steps.image.outputs.name }}:latest