-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (65 loc) · 2.08 KB
/
Copy pathrelease.yml
File metadata and controls
76 lines (65 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: Release tag to build assets for
required: true
type: string
permissions:
contents: write
jobs:
build-assets:
name: Build release assets on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
env:
RELEASE_TAG: ${{ github.event.release.tag_name || inputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || inputs.tag }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: npm ci
- name: Build macOS app bundle
if: runner.os == 'macOS'
run: |
npm run tauri -- build --bundles app
mkdir -p release-assets
ditto -c -k --sequesterRsrc --keepParent \
"target/release/bundle/macos/Remote Codex API.app" \
"release-assets/Remote-Codex-API_${RELEASE_TAG}_macOS.app.zip"
- name: Build Windows installers
if: runner.os == 'Windows'
shell: pwsh
run: |
npm run tauri -- build --bundles "nsis,msi"
New-Item -ItemType Directory -Force release-assets | Out-Null
Get-ChildItem target/release/bundle -Recurse -Include *.exe,*.msi | ForEach-Object {
Copy-Item $_.FullName "release-assets/Remote-Codex-API_${env:RELEASE_TAG}_Windows_$($_.Name)"
}
- name: Upload release assets
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
shopt -s nullglob
files=(release-assets/*)
if [ ${#files[@]} -eq 0 ]; then
echo "No release assets were generated."
exit 1
fi
gh release upload "$RELEASE_TAG" "${files[@]}" --repo "$GITHUB_REPOSITORY" --clobber