1.15.0 #34
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "app-v*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Release tag to build, for example app-v0.1.0" | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| env: | |
| RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }} | |
| jobs: | |
| release: | |
| name: Build ${{ matrix.label }} | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - label: macOS Intel | |
| target: x86_64-apple-darwin | |
| args: --target x86_64-apple-darwin | |
| stableAsset: codex-usage-desktop-macos-x64.dmg | |
| - label: macOS Apple Silicon | |
| target: aarch64-apple-darwin | |
| args: --target aarch64-apple-darwin | |
| stableAsset: codex-usage-desktop-macos-arm64.dmg | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ env.RELEASE_TAG }} | |
| fetch-depth: 0 | |
| - name: Validate release tag | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| version="$(node -p "require('./src-tauri/tauri.conf.json').version")" | |
| expected="app-v${version}" | |
| if [[ "${RELEASE_TAG}" != "${expected}" ]]; then | |
| echo "Release tag ${RELEASE_TAG} does not match src-tauri/tauri.conf.json version ${version}." | |
| echo "Expected tag: ${expected}" | |
| exit 1 | |
| fi | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| with: | |
| version: 10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Cache Rust | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri -> target | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Test frontend | |
| run: pnpm test | |
| - name: Typecheck frontend | |
| run: pnpm typecheck | |
| - name: Generate release notes | |
| id: release_notes | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| previous_tag="$(git describe --tags --match 'app-v*' --abbrev=0 "${RELEASE_TAG}^" 2>/dev/null || true)" | |
| if [[ -n "${previous_tag}" ]]; then | |
| range="${previous_tag}..${RELEASE_TAG}" | |
| else | |
| range="${RELEASE_TAG}" | |
| fi | |
| { | |
| echo "## What's Changed" | |
| echo | |
| has_changes=false | |
| version_bump_regex='^chore(\([^)]*\))?:[[:space:]]*[0-9]+\.[0-9]+\.[0-9]+$' | |
| while IFS= read -r subject; do | |
| [[ -z "${subject}" ]] && continue | |
| if [[ "${subject}" =~ ${version_bump_regex} ]]; then | |
| continue | |
| fi | |
| has_changes=true | |
| echo "- ${subject}" | |
| done < <(git log --format=%s --reverse "${range}") | |
| if [[ "${has_changes}" == "false" ]]; then | |
| echo "- No notable commit changes." | |
| fi | |
| echo | |
| if [[ -n "${previous_tag}" ]]; then | |
| echo "**Full Changelog**: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/compare/${previous_tag}...${RELEASE_TAG}" | |
| else | |
| echo "**Full Changelog**: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commits/${RELEASE_TAG}" | |
| fi | |
| } > release-notes.md | |
| { | |
| echo "body<<EOF" | |
| cat release-notes.md | |
| echo "EOF" | |
| } >> "${GITHUB_OUTPUT}" | |
| - name: Build and publish Tauri app | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| with: | |
| tagName: ${{ env.RELEASE_TAG }} | |
| releaseName: Codex Usage Desktop ${{ env.RELEASE_TAG }} | |
| releaseBody: ${{ steps.release_notes.outputs.body }} | |
| releaseDraft: false | |
| prerelease: false | |
| args: ${{ matrix.args }} | |
| - name: Prepare stable DMG asset | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| search_dirs=() | |
| for dir in \ | |
| "src-tauri/target/${{ matrix.target }}/release/bundle/dmg" \ | |
| "src-tauri/target/release/bundle/dmg" | |
| do | |
| if [[ -d "${dir}" ]]; then | |
| search_dirs+=("${dir}") | |
| fi | |
| done | |
| if [[ "${#search_dirs[@]}" -eq 0 ]]; then | |
| echo "No Tauri DMG bundle directories were found." | |
| exit 1 | |
| fi | |
| dmg="$(find "${search_dirs[@]}" -maxdepth 1 -type f -name '*.dmg' | head -n 1)" | |
| if [[ -z "${dmg}" ]]; then | |
| echo "No DMG bundle was found." | |
| exit 1 | |
| fi | |
| mkdir -p release-assets | |
| cp "${dmg}" "release-assets/${{ matrix.stableAsset }}" | |
| - name: Upload stable DMG asset | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| tag_name: ${{ env.RELEASE_TAG }} | |
| files: release-assets/${{ matrix.stableAsset }} |