Skip to content

Commit

Permalink
remaning template ToDos (mostly renaming the game) [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
bbarker committed Dec 10, 2023
1 parent 0a0f766 commit 9be71a1
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 127 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/release-android-google-play.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ on:
required: true
type: string

# ToDo: adapt names
env:
# used for uploading the app to a GitHub release
GAME_EXECUTABLE_NAME: bevy_game
GAME_EXECUTABLE_NAME: voxel_vegetables
BUNDLE_PATH: "target/x/release/android/mobile.aab"
PACKAGE_NAME: "me.nikl.bevygame"
PACKAGE_NAME: "io.github.bbarker.voxel-vegetables"
# release track; you can promote a build to "higher" tracks in the play console or publish to a different track directly
# see track at https://github.com/r0adkll/upload-google-play#inputs for more options
TRACK: internal
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release-ios-testflight.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ on:
required: true
type: string

# ToDo: adapt names
env:
# used for uploading the app to a GitHub release
GAME_EXECUTABLE_NAME: bevy_game
GAME_EXECUTABLE_NAME: voxel_vegetables
XCODE_PROJECT: mobile
MOBILE_DIRECTORY: mobile

Expand Down
213 changes: 106 additions & 107 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ on:
required: true
type: string

# ToDo: adapt names
env:
# heads-up: this value is used as a pattern in an sed command as a workaround for a trunk issue
# if you use special characters, take a look at the 'Make paths relative' step in the 'build-web' job
GAME_EXECUTABLE_NAME: bevy_game
GAME_OSX_APP_NAME: BevyGame
GAME_EXECUTABLE_NAME: voxel_vegetables
GAME_OSX_APP_NAME: VoxelVegetables

permissions:
contents: write
Expand Down Expand Up @@ -170,109 +169,109 @@ jobs:
tag: ${{ env.VERSION }}
overwrite: true

build-web:
runs-on: ubuntu-latest
needs: get-version
env:
VERSION: ${{needs.get-version.outputs.version}}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Install Dependencies
run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev
- name: Install trunk
uses: jetli/[email protected]
with:
version: latest
- name: Add wasm target
run: |
rustup target add wasm32-unknown-unknown
- name: Build Release
run: |
trunk build --release
- name: Optimize Wasm
uses: NiklasEi/wasm-opt-action@v2
with:
file: dist/*.wasm
# Trunk cannot import assets from relative paths (see e.g. https://github.com/thedodd/trunk/issues/395)
# On sites like itch.io, we don't know on which base path the game gets served, so we need to rewrite all links to be relative
- name: Make paths relative
run: |
sed -i 's/\/index/.\/index/g' dist/index.html
sed -i 's/\/${{ env.GAME_EXECUTABLE_NAME }}/.\/${{ env.GAME_EXECUTABLE_NAME }}/g' dist/index.html
- name: Zip release
uses: vimtor/action-zip@v1
with:
files: dist/
dest: ${{ env.GAME_EXECUTABLE_NAME }}_web.zip
- name: Upload release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.GAME_EXECUTABLE_NAME }}_web.zip
asset_name: ${{ env.GAME_EXECUTABLE_NAME }}_${{ env.VERSION }}_web.zip
release_name: ${{ env.VERSION }}
tag: ${{ env.VERSION }}
overwrite: true
# build-web:
# runs-on: ubuntu-latest
# needs: get-version
# env:
# VERSION: ${{needs.get-version.outputs.version}}
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# - name: Install rust toolchain
# uses: dtolnay/rust-toolchain@master
# with:
# toolchain: stable
# - name: Install Dependencies
# run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev
# - name: Install trunk
# uses: jetli/[email protected]
# with:
# version: latest
# - name: Add wasm target
# run: |
# rustup target add wasm32-unknown-unknown
# - name: Build Release
# run: |
# trunk build --release
# - name: Optimize Wasm
# uses: NiklasEi/wasm-opt-action@v2
# with:
# file: dist/*.wasm
# # Trunk cannot import assets from relative paths (see e.g. https://github.com/thedodd/trunk/issues/395)
# # On sites like itch.io, we don't know on which base path the game gets served, so we need to rewrite all links to be relative
# - name: Make paths relative
# run: |
# sed -i 's/\/index/.\/index/g' dist/index.html
# sed -i 's/\/${{ env.GAME_EXECUTABLE_NAME }}/.\/${{ env.GAME_EXECUTABLE_NAME }}/g' dist/index.html
# - name: Zip release
# uses: vimtor/action-zip@v1
# with:
# files: dist/
# dest: ${{ env.GAME_EXECUTABLE_NAME }}_web.zip
# - name: Upload release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ${{ env.GAME_EXECUTABLE_NAME }}_web.zip
# asset_name: ${{ env.GAME_EXECUTABLE_NAME }}_${{ env.VERSION }}_web.zip
# release_name: ${{ env.VERSION }}
# tag: ${{ env.VERSION }}
# overwrite: true

build-for-iOS:
runs-on: macos-latest
timeout-minutes: 30
needs: get-version
env:
VERSION: ${{needs.get-version.outputs.version}}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Add iOS targets
run: rustup target add aarch64-apple-ios x86_64-apple-ios
- name: Build app for iOS
run: |
cd mobile
make xcodebuild-iphone-release
mkdir Payload
mv build/Build/Products/Release-iphoneos/*.app Payload
zip -r ${{ env.GAME_EXECUTABLE_NAME }}.zip Payload
mv ${{ env.GAME_EXECUTABLE_NAME }}.zip ${{ env.GAME_EXECUTABLE_NAME }}.ipa
- name: Upload release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: mobile/${{ env.GAME_EXECUTABLE_NAME }}.ipa
asset_name: ${{ env.GAME_EXECUTABLE_NAME }}_${{ env.VERSION }}_unsigned_ios.ipa
release_name: ${{ env.VERSION }}
tag: ${{ env.VERSION }}
overwrite: true
# build-for-iOS:
# runs-on: macos-latest
# timeout-minutes: 30
# needs: get-version
# env:
# VERSION: ${{needs.get-version.outputs.version}}
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# - name: Add iOS targets
# run: rustup target add aarch64-apple-ios x86_64-apple-ios
# - name: Build app for iOS
# run: |
# cd mobile
# make xcodebuild-iphone-release
# mkdir Payload
# mv build/Build/Products/Release-iphoneos/*.app Payload
# zip -r ${{ env.GAME_EXECUTABLE_NAME }}.zip Payload
# mv ${{ env.GAME_EXECUTABLE_NAME }}.zip ${{ env.GAME_EXECUTABLE_NAME }}.ipa
# - name: Upload release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: mobile/${{ env.GAME_EXECUTABLE_NAME }}.ipa
# asset_name: ${{ env.GAME_EXECUTABLE_NAME }}_${{ env.VERSION }}_unsigned_ios.ipa
# release_name: ${{ env.VERSION }}
# tag: ${{ env.VERSION }}
# overwrite: true

build-for-Android:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: get-version
env:
VERSION: ${{needs.get-version.outputs.version}}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Add Android targets
# could add more targets like armv7-linux-androideabi here (then also add to cargo-apk config)
run: rustup target add aarch64-linux-android
- name: Install Cargo APK
run: cargo install --force cargo-apk
- name: Build app for Android
run: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME cargo apk build --package mobile
env:
# This will reduce the APK size from 1GB to ~200MB
CARGO_PROFILE_DEV_DEBUG: false
- name: Upload release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/debug/apk/${{ env.GAME_OSX_APP_NAME }}.apk
asset_name: ${{ env.GAME_EXECUTABLE_NAME }}_${{ env.VERSION }}_android.apk
release_name: ${{ env.VERSION }}
tag: ${{ env.VERSION }}
overwrite: true
# build-for-Android:
# runs-on: ubuntu-latest
# timeout-minutes: 30
# needs: get-version
# env:
# VERSION: ${{needs.get-version.outputs.version}}
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# - name: Add Android targets
# # could add more targets like armv7-linux-androideabi here (then also add to cargo-apk config)
# run: rustup target add aarch64-linux-android
# - name: Install Cargo APK
# run: cargo install --force cargo-apk
# - name: Build app for Android
# run: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME cargo apk build --package mobile
# env:
# # This will reduce the APK size from 1GB to ~200MB
# CARGO_PROFILE_DEV_DEBUG: false
# - name: Upload release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: target/debug/apk/${{ env.GAME_OSX_APP_NAME }}.apk
# asset_name: ${{ env.GAME_EXECUTABLE_NAME }}_${{ env.VERSION }}_android.apk
# release_name: ${{ env.VERSION }}
# tag: ${{ env.VERSION }}
# overwrite: true
8 changes: 4 additions & 4 deletions build/macos/src/Game.app/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>BevyGame</string> <!-- ToDo: this should be the same as your OSX app name in the release flow -->
<string>VoxelVegetables</string> <!-- Note: this should be the same as your OSX app name in the release flow -->
<key>CFBundleExecutable</key>
<string>bevy_game</string> <!-- ToDo: this should be the same as your executable name in the release flow -->
<string>voxel_vegetables</string> <!-- Note: this should be the same as your executable name in the release flow -->
<key>CFBundleIconFile</key>
<string>AppIcon.icns</string>
<key>CFBundleIdentifier</key>
<string>your.domain.bevy-game</string> <!-- ToDo -->
<string>io.github.bbarker.voxel-vegetables</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Bevy Game</string> <!-- ToDo -->
<string>Voxel Vegetables</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
Expand Down
9 changes: 4 additions & 5 deletions build/windows/installer/Package.wxs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<!-- ToDo use your own keys for Name and Manufacturer, as well as a new UUID for UpgradeCode -->
<Package
Name="BevyGame"
Manufacturer="My Name"
UpgradeCode="12345678-de4f-4893-a535-93dfd0597731"
Name="VoxelVegetables"
Manufacturer="Brandon Barker, Space Nerde"
UpgradeCode="4412bde4-fd73-414e-9d59-9d4459795f97"
Version="0.1.0"

Scope="perUserOrMachine">
Expand Down Expand Up @@ -35,7 +34,7 @@
<!-- Installs the actual files -->
<ComponentGroup Id="MainComponent" Directory="INSTALLFOLDER">
<Component>
<File Id="Executable" Source="..\..\..\target\release\bevy_game.exe" Vital="true" /> <!-- ToDo this should point to your executable -->
<File Id="Executable" Source="..\..\..\target\release\voxel_vegetables.exe" Vital="true" /> <!-- Note: this should point to your executable -->
</Component>
</ComponentGroup>

Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Bevy game</title> <!-- ToDo -->
<title>Voxel Vegetables</title>
<link data-trunk rel="copy-dir" href="assets"/>
<link data-trunk rel="copy-dir" href="credits"/>
<link data-trunk rel="copy-file" href="build/windows/icon.ico"/>
Expand Down
6 changes: 3 additions & 3 deletions mobile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ version = "0.15"
features = ["oboe-shared-stdcxx"]

[package.metadata.android]
package = "me.nikl.bevygame" # ToDo
apk_name = "BevyGame" # ToDo same as GAME_OSX_APP_NAME in release workflow
package = "io.github.bbarker.voxel-vegetables"
apk_name = "VoxelVegetables" # Note: same as GAME_OSX_APP_NAME in release workflow
assets = "../assets"
strip = "strip"
resources = "../build/android/res"
Expand All @@ -31,4 +31,4 @@ target_sdk_version = 33

[package.metadata.android.application]
icon = "@mipmap/icon"
label = "Bevy Game" # ToDo
label = "Voxel Vegetables"
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use bevy::DefaultPlugins;
use bevy_voxel_world::prelude::*;
use build_common::*;
use std::io::Cursor;
use strum::EnumCount; // ToDo: Replace bevy_game with your new crate name.
use strum::EnumCount;
use voxel_vegetables::GamePlugin;
use winit::window::Icon;

Expand All @@ -27,7 +27,7 @@ fn main() {
.insert_resource(ClearColor(Color::rgb(0.4, 0.4, 0.4)))
.add_plugins(DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
title: "Bevy game".to_string(), // ToDo
title: "Voxel Vegetables".to_string(),
// Bind to canvas included in `index.html`
canvas: Some("#bevy".to_owned()),
// The canvas size is constrained in index.html and build/web/styles.css
Expand Down

0 comments on commit 9be71a1

Please sign in to comment.