BlueGit

ict rusty-teams

Files

rusty-teams / .github / workflows / build.yml

build.yml

26163bad History
build.yml 4.0 KiB Download Raw
1# Builds per README "Quick start": `cargo build -p app`, plus the universal macOS
2# binary from scripts/build-macos.sh. Tests live in test.yml; this file only
3# packages the artifacts.
4name: Build
5
6# Builds run for tags (the release assets); pushes are tested in test.yml.
7# A `v*` tag also publishes a GitHub release; a tag with `-` (v0.2.0-rc.1) is a pre-release.
8on:
9 push:
10 tags: ['*']
11 workflow_dispatch:
12
13permissions:
14 contents: read
15
16concurrency:
17 group: ${{ github.workflow }}-${{ github.ref }}
18 cancel-in-progress: true
19
20env:
21 CARGO_TERM_COLOR: always
22
23jobs:
24 linux:
25 name: Linux
26 runs-on: ubuntu-latest
27 timeout-minutes: 90
28 # webrtc-sys compiles its C++ against the hermetic libc++ inside the libwebrtc
29 # artifact, which needs a clang as new as that libc++ (clang 21 today, see
30 # check_clang_version in vendor/webrtc-sys/build.rs). The distro clang is older
31 # (18 on ubuntu-24.04), so setup-linux installs clang 21 and these point every
32 # compile and the final link at it.
33 env:
34 CC: clang-21
35 CXX: clang++-21
36 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang-21
37 steps:
38 - uses: actions/checkout@v6
39
40 - uses: ./.github/actions/setup-linux
41
42 - uses: dtolnay/rust-toolchain@stable
43
44 - uses: Swatinem/rust-cache@v2
45 with:
46 key: build
47
48 - name: Build
49 run: cargo build -p app --release
50
51 # The runner is x86_64; the artifact name carries the architecture.
52 - uses: actions/upload-artifact@v7
53 with:
54 name: teams-linux-amd64
55 path: target/release/teams
56
57 windows:
58 name: Windows
59 runs-on: windows-latest
60 timeout-minutes: 90
61 defaults:
62 run:
63 shell: bash
64 steps:
65 - uses: actions/checkout@v6
66
67 - uses: dtolnay/rust-toolchain@stable
68
69 - uses: Swatinem/rust-cache@v2
70 with:
71 key: build
72
73 # After the toolchain: staging runs `cargo metadata`.
74 - uses: ./.github/actions/setup-windows
75
76 # fxc.exe comes from the Windows SDK, gpui-pre-windows finds it through the registry.
77 - name: Build
78 run: cargo build -p app --release --config "patch.crates-io.gpui-pre-windows.path=\"$GPUI_PRE_WINDOWS_PATCHED\""
79
80 # The runner is x86_64; the artifact name carries the architecture.
81 - uses: actions/upload-artifact@v7
82 with:
83 name: teams-windows-amd64
84 path: target/release/teams.exe
85
86 macos:
87 name: macOS
88 runs-on: macos-latest
89 timeout-minutes: 90
90 steps:
91 - uses: actions/checkout@v6
92
93 - uses: dtolnay/rust-toolchain@stable
94
95 - uses: Swatinem/rust-cache@v2
96 with:
97 key: build
98
99 # scripts/build-macos.sh builds the arm64 and x86_64 slices, lipos them into
100 # one universal binary and wraps it in a .app with the icon (README "Quick
101 # start"); it installs the x86_64 rustup target itself and needs Xcode CLT only.
102 - name: Build
103 run: scripts/build-macos.sh crates/app teams
104
105 - uses: actions/upload-artifact@v7
106 with:
107 name: teams-macos
108 path: target/universal/release/teams-macos.zip
109
110 release:
111 name: Release
112 needs: [linux, windows, macos]
113 if: startsWith(github.ref, 'refs/tags/v')
114 runs-on: ubuntu-latest
115 permissions:
116 contents: write
117 steps:
118 - uses: actions/download-artifact@v8
119 with:
120 path: dist
121
122 # Artifacts drop the executable bit, the tarball restores it.
123 - name: Package
124 env:
125 TAG: ${{ github.ref_name }}
126 run: |
127 mkdir release
128 chmod +x dist/teams-linux-amd64/teams
129 tar -czf "release/rusty-teams-$TAG-linux-amd64.tar.gz" -C dist/teams-linux-amd64 teams
130 cp dist/teams-windows-amd64/teams.exe "release/rusty-teams-$TAG-windows-amd64.exe"
131 cp dist/teams-macos/teams-macos.zip "release/rusty-teams-$TAG-macos-universal.zip"
132
133 - uses: softprops/action-gh-release@v3
134 with:
135 files: release/*
136 generate_release_notes: true
137 prerelease: ${{ contains(github.ref_name, '-') }}