Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 0 additions & 68 deletions .cirrus.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on:
merge_group:
pull_request:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read

jobs:
lint:
name: Lint
runs-on: ghcr.io/cirruslabs/macos-runner:tahoe
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Install lint components
run: rustup component add clippy rustfmt
- name: Check formatting
run: cargo fmt --check
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings

test:
name: Test on macOS ${{ matrix.macos }}
runs-on: ghcr.io/cirruslabs/macos-runner:${{ matrix.runner }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- macos: Sequoia
runner: sequoia
- macos: Tahoe
runner: tahoe
steps:
- uses: actions/checkout@v6
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Run tests
run: cargo test
84 changes: 84 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Release

on:
push:
tags:
- "*"
workflow_dispatch:

permissions:
contents: read

jobs:
release:
name: Release
if: github.event_name == 'push' && github.ref_type == 'tag'
runs-on: ghcr.io/cirruslabs/macos-runner:tahoe
environment: publish
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Install release targets
run: rustup target add aarch64-apple-darwin x86_64-apple-darwin
- name: Create release app token for this repo
id: app-token
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
permission-contents: write
- name: Create release app token for homebrew-tools
id: tap-token
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
owner: openai
repositories: homebrew-tools
permission-contents: write
permission-pull-requests: write
- name: Release
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser-pro
version: "~> v2"
args: release --clean

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate tag releases on CI

When this tag workflow reaches goreleaser release --clean, it publishes without any preceding lint or test job; the new CI workflow only runs on PRs, merge groups, manual runs, and pushes to the main branch, so tag pushes do not exercise it. The removed Cirrus release task depended on both Lint and Test, so tagging a broken commit can now publish artifacts before formatting, clippy, or the macOS test matrix has passed; add equivalent checks to this workflow or otherwise make tag releases wait for a tag-triggered CI run.

Useful? React with 👍 / 👎.

env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ steps.tap-token.outputs.token }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

snapshot:
name: Release (Dry Run)
if: github.event_name == 'workflow_dispatch'
runs-on: ghcr.io/cirruslabs/macos-runner:tahoe
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Install release targets
run: rustup target add aarch64-apple-darwin x86_64-apple-darwin
- name: Release dry run
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser-pro
version: "~> v2"
args: release --skip=publish --snapshot --clean
- name: Upload dry-run artifacts
uses: actions/upload-artifact@v6
with:
name: softnet-snapshot
path: dist/**
11 changes: 8 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ release:
brews:
- name: "{{ .ProjectName }}"
repository:
owner: cirruslabs
name: homebrew-cli
owner: openai
name: homebrew-tools
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
branch: "softnet-{{ .Version }}"
pull_request:
enabled: true
directory: Formula
caveats: See the Github repository for more information
homepage: https://github.com/cirruslabs/softnet
homepage: https://github.com/openai/softnet
description: Software networking with isolation for Tart
skip_upload: auto
custom_block: |
Expand Down
Loading