Skip to content

Commit fff090d

Browse files
committed
fix ci
1 parent abe0828 commit fff090d

1 file changed

Lines changed: 96 additions & 0 deletions

File tree

.github/workflows/ios.build.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Build chums-proxy
2+
3+
on: push
4+
5+
jobs:
6+
build-ios:
7+
name: Build for aarch64-apple-ios
8+
runs-on: [self-hosted, macOS, ARM64]
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v3
12+
13+
- name: Build for aarch64-apple-ios
14+
run: cargo build --target aarch64-apple-ios --lib --release
15+
16+
- name: Update dylib
17+
run: |
18+
cd target/aarch64-apple-ios/release
19+
lipo "libchums_proxy.dylib" -output "libchums_proxy" -create
20+
21+
- name: Clone flutter-chums-proxy repository
22+
run: |
23+
git clone https://github.com/Chums-Team/flutter-chums-proxy.git flutter-chums-proxy
24+
25+
- name: ZIP artifacts
26+
run: |
27+
mkdir -p dist
28+
cp target/aarch64-apple-ios/release/libchums_proxy.* dist/
29+
cp -r flutter-chums-proxy/chums_proxy_ios/ios/Frameworks/libchums_proxy.xcframework dist/
30+
cp target/aarch64-apple-ios/release/libchums_proxy dist/libchums_proxy.xcframework/ios-arm64/libchums_proxy.framework
31+
cd dist/
32+
zip -r chums-proxy-ios.zip .
33+
34+
- name: Upload artifact
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: chums-proxy-ios
38+
path: dist/chums-proxy-ios.zip
39+
40+
build-windows:
41+
name: Build for x86_64-pc-windows-gnu
42+
runs-on: windows-latest
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v3
46+
47+
- name: Set up Rust + target
48+
run: rustup target add x86_64-pc-windows-gnu
49+
50+
- name: Build for x86_64-pc-windows-gnu
51+
run: cargo build --target x86_64-pc-windows-gnu --lib --release
52+
53+
- name: ZIP artifacts
54+
run: |
55+
mkdir -p dist
56+
cp target/x86_64-pc-windows-gnu/release/libchums_proxy.* dist/
57+
cd dist/
58+
zip -r chums-proxy-windows.zip .
59+
60+
- name: Upload artifact
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: chums-proxy-windows
64+
path: dist/chums-proxy-windows.zip
65+
66+
release:
67+
name: Create GitHub Release
68+
runs-on: [self-hosted, macOS, ARM64]
69+
needs:
70+
- build-ios
71+
- build-windows
72+
steps:
73+
- name: Download artifact
74+
uses: actions/download-artifact@v4
75+
with:
76+
name: chums-proxy-ios
77+
path: dist
78+
79+
- name: Generate timestamp
80+
id: meta
81+
run: |
82+
timestamp="$(date +'%Y-%m-%dT%H-%M-%S')"
83+
echo "tag_name=v$timestamp" >> "$GITHUB_OUTPUT"
84+
echo "release_name=Release ${timestamp//T/ }" >> "$GITHUB_OUTPUT"
85+
86+
- name: Create GitHub Release
87+
uses: softprops/action-gh-release@v2
88+
with:
89+
name: ${{ steps.meta.outputs.release_name }}
90+
tag_name: ${{ steps.meta.outputs.tag_name }}
91+
files: |
92+
dist/chums-proxy-ios.zip
93+
dist/chums-proxy-windows.zip
94+
generate_release_notes: true
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)