Publish Softnet releases to homebrew-tools
This commit is contained in:
parent
80564552a1
commit
93b1c97d9e
|
|
@ -7,26 +7,44 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: ${{ github.ref_type == 'tag' && 'Release' || 'Release (Dry Run)' }}
|
name: ${{ github.ref_type == 'tag' && 'Release' || 'Release (Dry Run)' }}
|
||||||
runs-on: ghcr.io/cirruslabs/macos-runner:tahoe
|
runs-on: ghcr.io/cirruslabs/macos-runner:tahoe
|
||||||
|
environment: publish
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
|
||||||
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
run: |
|
run: |
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
|
||||||
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
||||||
- name: Install release targets
|
- name: Install release targets
|
||||||
run: rustup target add aarch64-apple-darwin x86_64-apple-darwin
|
run: rustup target add aarch64-apple-darwin x86_64-apple-darwin
|
||||||
|
- name: Create release app token for this repo
|
||||||
|
if: github.ref_type == 'tag'
|
||||||
|
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
|
||||||
|
if: github.ref_type == 'tag'
|
||||||
|
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
|
- name: Release
|
||||||
if: github.ref_type == 'tag'
|
if: github.ref_type == 'tag'
|
||||||
uses: goreleaser/goreleaser-action@v7
|
uses: goreleaser/goreleaser-action@v7
|
||||||
|
|
@ -34,6 +52,10 @@ jobs:
|
||||||
distribution: goreleaser-pro
|
distribution: goreleaser-pro
|
||||||
version: "~> v2"
|
version: "~> v2"
|
||||||
args: release --clean
|
args: release --clean
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
|
HOMEBREW_TAP_GITHUB_TOKEN: ${{ steps.tap-token.outputs.token }}
|
||||||
|
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
||||||
- name: Release dry run
|
- name: Release dry run
|
||||||
if: github.ref_type != 'tag'
|
if: github.ref_type != 'tag'
|
||||||
uses: goreleaser/goreleaser-action@v7
|
uses: goreleaser/goreleaser-action@v7
|
||||||
|
|
@ -41,6 +63,8 @@ jobs:
|
||||||
distribution: goreleaser-pro
|
distribution: goreleaser-pro
|
||||||
version: "~> v2"
|
version: "~> v2"
|
||||||
args: release --skip=publish --snapshot --clean
|
args: release --skip=publish --snapshot --clean
|
||||||
|
env:
|
||||||
|
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
||||||
- name: Upload dry-run artifacts
|
- name: Upload dry-run artifacts
|
||||||
if: github.ref_type != 'tag'
|
if: github.ref_type != 'tag'
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v6
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,12 @@ release:
|
||||||
brews:
|
brews:
|
||||||
- name: "{{ .ProjectName }}"
|
- name: "{{ .ProjectName }}"
|
||||||
repository:
|
repository:
|
||||||
owner: cirruslabs
|
owner: openai
|
||||||
name: homebrew-cli
|
name: homebrew-tools
|
||||||
|
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
|
||||||
|
branch: "softnet-{{ .Version }}"
|
||||||
|
pull_request:
|
||||||
|
enabled: true
|
||||||
caveats: See the Github repository for more information
|
caveats: See the Github repository for more information
|
||||||
homepage: https://github.com/openai/softnet
|
homepage: https://github.com/openai/softnet
|
||||||
description: Software networking with isolation for Tart
|
description: Software networking with isolation for Tart
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue