Skip to content

Commit

Permalink
Add glow feature and generate wgpu & glow variants for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
fengalin committed Jan 30, 2024
1 parent 77ff328 commit 5fe9e94
Show file tree
Hide file tree
Showing 4 changed files with 202 additions and 12 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,19 @@ jobs:
shell: bash

- name: Build for x86_64
run: cargo build --release
run: |
cargo build --release --no-default-features --features glow
mv target/release/jstation-controller target/release/jstation-controller-glow
cargo build --release
- name: Build for aarch64
run: |
export SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path)
echo "SDKROOT=$SDKROOT"
export MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version)
echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET"
cargo build --release --target=aarch64-apple-darwin --no-default-features --features glow
mv target/aarch64-apple-darwin/release/jstation-controller target/aarch64-apple-darwin/release/jstation-controller-glow
cargo build --release --target=aarch64-apple-darwin
env:
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
Expand All @@ -120,15 +125,18 @@ jobs:

- name: Package
run: |
mkdir -p temp/${{ env.app_variant }}
cp README.md temp/${{ env.app_variant }}/
cargo-about generate -o temp/${{ env.app_variant }}/LICENSES.html about.hbs
lipo target/release/${APP_NAME} target/aarch64-apple-darwin/release/${APP_NAME} -output temp/${{ env.app_variant }}/${APP_NAME} -create
mkdir -p packages
cd packages
TAR=${{ env.app_variant }}.tar.gz
tar -czf ${TAR} --directory=../temp ${{ env.app_variant }}
shasum -a 256 ${TAR} > ${TAR}.sha256
for BACKEND in "" "-glow"; do \
mkdir -p temp/${{ env.app_variant }}${BACKEND} \
cp README.md temp/${{ env.app_variant }}${BACKEND}/ \
cargo-about generate -o temp/${{ env.app_variant }}${BACKEND}/LICENSES.html about.hbs \
lipo target/release/${APP_NAME}${BACKEND} target/aarch64-apple-darwin/release/${APP_NAME}${BACKEND} -output temp/${{ env.app_variant }}/${APP_NAME}${BACKEND} -create \
mkdir -p packages \
pushd packages \
TAR=${{ env.app_variant }}${BACKEND}.tar.gz \
tar -czf ${TAR} --directory=../temp ${{ env.app_variant }}${BACKEND} \
shasum -a 256 ${TAR} > ${TAR}.sha256 \
popd \
done;
shell: bash

- name: Upload macos packages
Expand Down
178 changes: 177 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ edition = "2021"
[dependencies]
env_logger = "0.11"
iced = { version = "0.9", features = [ "smol" ] }
iced_audio = "0.12"
iced_audio = { version = "0.12", default-features = false }
iced_lazy = "0.6.1"
iced_native = "0.10.3"
jstation_derive = { path = "jstation_derive" }
Expand All @@ -25,5 +25,10 @@ smallvec = { version = "1.10", features = [ "const_generics", "union" ] }
smol = "1.3"
thiserror = "1.0"

[features]
default = ["wgpu"]
wgpu = ["iced/wgpu", "iced_audio/wgpu"]
glow = ["iced/glow", "iced_audio/glow"]

[profile.release]
lto = true
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ allow = [
"BSD-2-Clause",
"BSD-3-Clause",
"BSL-1.0",
"CC0-1.0",
"ISC",
"MIT",
"MIT-0",
Expand Down

0 comments on commit 5fe9e94

Please sign in to comment.