-
Notifications
You must be signed in to change notification settings - Fork 27
85 lines (72 loc) · 2.67 KB
/
build_macos_release.yml
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
77
78
79
80
81
82
83
84
85
name: macOS
on:
create:
workflow_dispatch:
# push:
# branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: macOS-latest
env:
APP_NAME: ethertia
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, rust-src, clippy
- name: Install Dependencies
run: |
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
- name: Build
run: |
cargo build --release --target x86_64-apple-darwin
cargo build --release --target aarch64-apple-darwin
- name: Zip Artifact
run: |
zip darwin-x86_64.zip "./target/x86_64-apple-darwin/release/${APP_NAME}" "./target/x86_64-apple-darwin/release/dedicated_server"
zip darwin-aarch64.zip "./target/aarch64-apple-darwin/release/${APP_NAME}" "./target/aarch64-apple-darwin/release/dedicated_server"
# mkdir -p "${APP_NAME}.app/Contents/MacOS"
# mkdir -p "${APP_NAME}.app/Contents/Resources"
# cp "./build/macOS/Info.plist" "${APP_NAME}.app/Contents/Info.plist"
# cp -a assets "${APP_NAME}.app/Contents/MacOS/"
# lipo "target/x86_64-apple-darwin/release/${APP_NAME}" \
# "target/aarch64-apple-darwin/release/${APP_NAME}" \
# -create -output "./build/macOS/${APP_NAME}.app/Contents/MacOS/${APP_NAME}"
# hdiutil create -fs HFS+ -volname "${APP_NAME}" -srcfolder "${APP_NAME}.app" ${APP_NAME}.dmg
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
./darwin-x86_64.zip
./darwin-aarch64.zip
# - name: Upload Artifacts
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./target/x86_64-apple-darwin/release/${APP_NAME}
# asset_name: ${APP_NAME}-darwin-amd64
# asset_content_type: application/octet-stream
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# body: |
# This is the release of ${APP_NAME}.
# draft: false
# prerelease: false