Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
004627887This file is pinned to the selected release. Download the original to open it in your design tool.
name: Release
on:
workflow_dispatch:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-codex.[0-9]+"
permissions:
contents: write
jobs:
build:
name: ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform: linux-x86_64
archive_suffix: linux-x86_64.tar.gz
- os: windows-latest
platform: windows-x86_64
archive_suffix: windows-x86_64.zip
- os: macos-latest
platform: macos
archive_suffix: macos.tar.gz
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Test release
run: cargo test --all --locked
- name: Lint release
run: cargo clippy --all-targets --all-features --locked -- -D warnings
- name: Build release binary
run: cargo build --release --locked
- name: Package archive
if: runner.os != 'Windows'
shell: bash
run: |
mkdir -p dist/package
cp target/release/konnect-codex README.md RELEASE_NOTES.md LICENSE compatibility.json dist/package/
cp -r docs policy dist/package/
tar -C dist/package -czf "dist/konnect-codex-${{ github.ref_name }}-${{ matrix.archive_suffix }}" .
- name: Package archive
if: runner.os == 'Windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Path dist/package -Force | Out-Null
Copy-Item target/release/konnect-codex.exe, README.md, RELEASE_NOTES.md, LICENSE, compatibility.json dist/package/
Copy-Item docs, policy -Destination dist/package/ -Recurse
Compress-Archive -Path dist/package/* -DestinationPath "dist/konnect-codex-${{ github.ref_name }}-${{ matrix.archive_suffix }}"
- uses: actions/upload-artifact@v7
with:
name: ${{ matrix.platform }}
path: dist/konnect-codex-${{ github.ref_name }}-${{ matrix.archive_suffix }}
if-no-files-found: error
publish:
name: Publish GitHub release
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/download-artifact@v7
with:
path: artifacts
merge-multiple: true
- name: Create checksums
run: cd artifacts && sha256sum konnect-codex-* > SHA256SUMS.txt
- name: Publish release
env:
GH_TOKEN: ${{ github.token }}
run: >-
gh release create "${{ github.ref_name }}" artifacts/*
--repo "${{ github.repository }}"
--verify-tag
--notes-file RELEASE_NOTES.md
--title "konnect-codex ${{ github.ref_name }}"