Skip to content

refactor(agent): modularize agent into submodules; add lib crate root #7

refactor(agent): modularize agent into submodules; add lib crate root

refactor(agent): modularize agent into submodules; add lib crate root #7

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.90.0
components: rustfmt, clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Build release
run: cargo build --release --verbose
- name: Determine host triple (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
echo "HOST_TRIPLE=$(rustc -Vv | sed -n 's/^host: //p')" >> $GITHUB_ENV
- name: Determine host triple (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$triple = (rustc -Vv | Select-String '^host:').Line.Split(':')[1].Trim()
echo "HOST_TRIPLE=$triple" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Package artifact (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
set -euxo pipefail
BIN_NAME=codex-acp
VERSION="${GITHUB_REF_NAME}"
ART_DIR=dist
mkdir -p "$ART_DIR"
SRC_BIN="target/release/${BIN_NAME}"
OUT_NAME="${BIN_NAME}-${VERSION}-${HOST_TRIPLE}.tar.gz"
tar -C target/release -czf "$ART_DIR/$OUT_NAME" "$BIN_NAME"
echo "ARTIFACT_PATH=$ART_DIR/$OUT_NAME" >> $GITHUB_ENV
- name: Package artifact (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$binName = 'codex-acp.exe'
$version = "${env:GITHUB_REF_NAME}"
$artDir = "dist"
New-Item -ItemType Directory -Force -Path $artDir | Out-Null
$src = "target/release/$binName"
$outName = "codex-acp-$version-$env:HOST_TRIPLE.zip"
Compress-Archive -Path $src -DestinationPath "$artDir/$outName"
echo "ARTIFACT_PATH=$artDir/$outName" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-artifact
path: ${{ env.ARTIFACT_PATH }}
release:
name: Publish Release
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/**/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}