Skip to content

Commit d1a853e

Browse files
committed
Merge branch 'master' into windows-support
2 parents 7344853 + 6a3cfc3 commit d1a853e

36 files changed

+3036
-1013
lines changed

.github/workflows/merges.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@ jobs:
1616
- name: Install Rust
1717
uses: dtolnay/rust-toolchain@stable
1818

19-
- name: Install macOS ARM64 target
20-
run: rustup target add aarch64-apple-darwin
21-
2219
- name: Check formatting
2320
run: cargo fmt --all --check
2421

25-
- name: Build for macOS ARM64
26-
run: cargo build --target aarch64-apple-darwin --all-features
22+
- name: Cargo check for macOS ARM64
23+
run: cargo check --target aarch64-apple-darwin

.github/workflows/release.yml

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,25 @@
11
name: Build macOS Release
2-
32
on:
43
push:
54
tags:
65
- "v*"
76
workflow_dispatch:
8-
97
permissions:
108
contents: write
119

1210
jobs:
1311
build-macos:
14-
strategy:
15-
matrix:
16-
include:
17-
- target: aarch64-apple-darwin
18-
os: macos-14
19-
- target: x86_64-apple-darwin
20-
os: macos-14
21-
22-
runs-on: ${{ matrix.os }}
23-
12+
runs-on: macos-14
13+
env:
14+
APP_VERSION: ${{ github.ref_name }}
2415
steps:
2516
- name: Checkout code
2617
uses: actions/checkout@v4
2718

2819
- name: Install Rust toolchain
2920
uses: dtolnay/rust-toolchain@stable
3021
with:
31-
targets: ${{ matrix.target }}
32-
33-
- name: Install cargo-bundle
34-
run: cargo install cargo-bundle
22+
targets: aarch64-apple-darwin,x86_64-apple-darwin
3523

3624
- name: Cache cargo registry
3725
uses: actions/cache@v4
@@ -49,31 +37,60 @@ jobs:
4937
uses: actions/cache@v4
5038
with:
5139
path: target
52-
key: ${{ runner.os }}-${{ matrix.target }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
40+
key: ${{ runner.os }}-universal-cargo-build-${{ hashFiles('**/Cargo.lock') }}
5341

54-
- name: Build release binary
55-
run: cargo bundle --release --target ${{ matrix.target }}
42+
- name: Build macOS app (universal)
43+
run: bash scripts/build-macos.sh
5644

45+
- name: Sign macOS app
46+
env:
47+
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
48+
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
49+
MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }}
50+
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.MACOS_CI_KEYCHAIN_PWD }}
51+
run: bash scripts/sign-macos.sh
52+
53+
- name: Package DMG
54+
run: bash scripts/package-macos.sh
55+
env:
56+
MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }}
57+
MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }}
58+
MACOS_NOTARY_TEAM_ID: ${{ secrets.MACOS_NOTARY_TEAM_ID }}
59+
MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }}
60+
61+
62+
# Homebrew-style artifact from the built .app
5763
- name: Create artifacts directory
5864
run: mkdir -p artifacts
5965

60-
- name: Package app bundle
66+
- name: Zip universal .app for Homebrew
67+
# APP_BUNDLE_PATH is set by scripts/build-macos.sh
6168
run: |
62-
cd target/${{ matrix.target }}/release/bundle/osx
63-
zip -r ../../../../../artifacts/rustcast-${{ matrix.target }}.app.zip *.app
69+
if [ -z "$APP_BUNDLE_PATH" ]; then
70+
echo "APP_BUNDLE_PATH not set by build-macos.sh" >&2
71+
exit 1
72+
fi
73+
APP_NAME=$(basename "$APP_BUNDLE_PATH")
74+
zip -r "artifacts/${APP_NAME%.app}-universal-macos.app.zip" "$APP_BUNDLE_PATH"
75+
76+
- name: Upload DMG artifact
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: rustcast-macos-dmg
80+
path: ${{ env.DMG_PATH }}
81+
retention-days: 7
6482

65-
- name: Upload artifacts
83+
- name: Upload .app zip artifact (Homebrew)
6684
uses: actions/upload-artifact@v4
6785
with:
68-
name: macos-${{ matrix.target }}
86+
name: macos-bundles
6987
path: artifacts/*.zip
7088
retention-days: 7
7189

7290
create-release:
7391
needs: build-macos
7492
runs-on: ubuntu-latest
7593
if: startsWith(github.ref, 'refs/tags/')
76-
7794
steps:
7895
- name: Download all artifacts
7996
uses: actions/download-artifact@v4
@@ -83,7 +100,10 @@ jobs:
83100
- name: Create release
84101
uses: softprops/action-gh-release@v1
85102
with:
86-
files: artifacts/**/*.zip
103+
# Include both DMG and .app zip(s)
104+
files: |
105+
artifacts/**/*.dmg
106+
artifacts/**/*.zip
87107
draft: false
88108
prerelease: false
89109
env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/target
2+
.DS_Store

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,34 @@ For bug fixes, and helping people to solve their github issues: see
2020
1. Code must compile...
2121
1. A video recording / screenshot would be an added bonus in getting your pull
2222
request merged faster.
23+
24+
## Codebase:
25+
26+
```
27+
.
28+
├── bundling # Bundling related stuff, ignore for the most bit
29+
│   ├── entitlements.plist
30+
│   ├── icon.icns
31+
│   └── Info.plist
32+
├── docs # Website and documentation related stuff. If something new is added to config, then modify this as well before PR-ing
33+
├── Cargo.lock
34+
├── Cargo.toml
35+
├── CONTRIBUTING.md # Contributing guidelines and codebase structure
36+
├── EXTENSIONS.md # Discussions about extensions implementation
37+
├── LICENSE.md # License file
38+
├── README.md # Readme file
39+
└── src
40+
├── app
41+
│   ├── apps.rs # Logic for the "apps" / commands that rustcast can perform
42+
│   ├── tile # Logic for the tile (rustcast window)
43+
│   │   ├── elm.rs # Logic for the elm architecture of the rustcast window (New and View)
44+
│   │   └── update.rs # Logic for the updating (elm architecture update) of the rustcast window
45+
│   └── tile.rs
46+
├── calculator.rs # Calculator logic
47+
├── commands.rs # Logic for different commands
48+
├── clipboard.rs # Logic for the clipboard history feature of rustcast
49+
├── config.rs # Configuration related stuff
50+
├── macos.rs # Macos specific config
51+
├── main.rs # Start app
52+
└── utils.rs # Common functions that are used across files
53+
```

0 commit comments

Comments
 (0)