Skip to content

Commit 41d0fc2

Browse files
committed
first commit
0 parents  commit 41d0fc2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1605
-0
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.avi filter=lfs diff=lfs merge=lfs -text

.github/workflows/ci.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
# Run cargo test
14+
test:
15+
name: Test Suite
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout sources
19+
uses: actions/checkout@v3
20+
- name: Cache
21+
uses: actions/cache@v3
22+
with:
23+
path: |
24+
~/.cargo/bin/
25+
~/.cargo/registry/index/
26+
~/.cargo/registry/cache/
27+
~/.cargo/git/db/
28+
target/
29+
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }}
30+
- name: Install stable toolchain
31+
uses: dtolnay/rust-toolchain@stable
32+
- name: Install Dependencies
33+
run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
34+
- name: Run cargo test
35+
run: cargo test
36+
37+
# Run cargo clippy -- -D warnings
38+
clippy_check:
39+
name: Clippy
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout sources
43+
uses: actions/checkout@v3
44+
- name: Cache
45+
uses: actions/cache@v3
46+
with:
47+
path: |
48+
~/.cargo/bin/
49+
~/.cargo/registry/index/
50+
~/.cargo/registry/cache/
51+
~/.cargo/git/db/
52+
target/
53+
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.toml') }}
54+
- name: Install stable toolchain
55+
uses: dtolnay/rust-toolchain@stable
56+
with:
57+
components: clippy
58+
- name: Install Dependencies
59+
run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
60+
- name: Run clippy
61+
run: cargo clippy -- -D warnings
62+
63+
# Run cargo fmt --all -- --check
64+
format:
65+
name: Format
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Checkout sources
69+
uses: actions/checkout@v3
70+
- name: Install stable toolchain
71+
uses: dtolnay/rust-toolchain@stable
72+
with:
73+
components: rustfmt
74+
- name: Run cargo fmt
75+
run: cargo fmt --all -- --check

.github/workflows/release.yml

+240
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
env:
9+
# update with the name of the main binary
10+
binary: bevy_github_ci_template
11+
add_binaries_to_github_release: true
12+
#itch_target: <itch.io-username>/<game-name>
13+
14+
15+
jobs:
16+
17+
# Build for wasm
18+
release-wasm:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: olegtarasov/[email protected]
23+
id: get_version
24+
- uses: actions/checkout@v3
25+
- uses: dtolnay/rust-toolchain@stable
26+
with:
27+
targets: wasm32-unknown-unknown
28+
- name: install wasm-bindgen-cli
29+
run: |
30+
cargo install wasm-bindgen-cli
31+
32+
- name: Build
33+
run: |
34+
cargo build --release --target wasm32-unknown-unknown
35+
36+
- name: Prepare package
37+
run: |
38+
wasm-bindgen --no-typescript --out-name bevy_game --out-dir wasm --target web target/wasm32-unknown-unknown/release/${{ env.binary }}.wasm
39+
cp -r assets wasm/
40+
41+
- name: Package as a zip
42+
working-directory: ./wasm
43+
run: |
44+
zip --recurse-paths ../${{ env.binary }}.zip .
45+
46+
- name: Upload binaries to artifacts
47+
uses: actions/upload-artifact@v3
48+
with:
49+
path: ${{ env.binary }}.zip
50+
name: wasm
51+
52+
- name: Upload binaries to release
53+
if: ${{ env.add_binaries_to_github_release == 'true' }}
54+
uses: svenstaro/upload-release-action@v2
55+
with:
56+
repo_token: ${{ secrets.GITHUB_TOKEN }}
57+
file: ${{ env.binary }}.zip
58+
asset_name: ${{ env.binary }}-wasm-${{ steps.get_version.outputs.tag }}.zip
59+
tag: ${{ github.ref }}
60+
overwrite: true
61+
62+
# Build for Linux
63+
release-linux:
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- uses: olegtarasov/[email protected]
68+
id: get_version
69+
- uses: actions/checkout@v3
70+
- uses: dtolnay/rust-toolchain@stable
71+
with:
72+
targets: x86_64-unknown-linux-gnu
73+
- name: install dependencies
74+
run: |
75+
sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
76+
77+
- name: Build
78+
run: |
79+
cargo build --release --target x86_64-unknown-linux-gnu
80+
81+
- name: Prepare package
82+
run: |
83+
mkdir linux
84+
cp target/x86_64-unknown-linux-gnu/release/${{ env.binary }} linux/
85+
cp -r assets linux/
86+
87+
- name: Package as a zip
88+
working-directory: ./linux
89+
run: |
90+
zip --recurse-paths ../${{ env.binary }}.zip .
91+
92+
- name: Upload binaries to artifacts
93+
uses: actions/upload-artifact@v3
94+
with:
95+
path: ${{ env.binary }}.zip
96+
name: linux
97+
98+
- name: Upload binaries to release
99+
if: ${{ env.add_binaries_to_github_release == 'true' }}
100+
uses: svenstaro/upload-release-action@v2
101+
with:
102+
repo_token: ${{ secrets.GITHUB_TOKEN }}
103+
file: ${{ env.binary }}.zip
104+
asset_name: ${{ env.binary }}-linux-${{ steps.get_version.outputs.tag }}.zip
105+
tag: ${{ github.ref }}
106+
overwrite: true
107+
108+
# Build for Windows
109+
release-windows:
110+
runs-on: windows-latest
111+
112+
steps:
113+
- uses: olegtarasov/[email protected]
114+
id: get_version
115+
- uses: actions/checkout@v3
116+
- uses: dtolnay/rust-toolchain@stable
117+
with:
118+
targets: x86_64-pc-windows-msvc
119+
120+
- name: Build
121+
run: |
122+
cargo build --release --target x86_64-pc-windows-msvc
123+
124+
- name: Prepare package
125+
run: |
126+
mkdir windows
127+
cp target/x86_64-pc-windows-msvc/release/${{ env.binary }}.exe windows/
128+
cp -r assets windows/
129+
130+
- name: Package as a zip
131+
run: |
132+
Compress-Archive -Path windows/* -DestinationPath ${{ env.binary }}.zip
133+
134+
- name: Upload binaries to artifacts
135+
uses: actions/upload-artifact@v3
136+
with:
137+
path: ${{ env.binary }}.zip
138+
name: windows
139+
140+
- name: Upload binaries to release
141+
if: ${{ env.add_binaries_to_github_release == 'true' }}
142+
uses: svenstaro/upload-release-action@v2
143+
with:
144+
repo_token: ${{ secrets.GITHUB_TOKEN }}
145+
file: ${{ env.binary }}.zip
146+
asset_name: ${{ env.binary }}-windows-${{ steps.get_version.outputs.tag }}.zip
147+
tag: ${{ github.ref }}
148+
overwrite: true
149+
150+
# Build for macOS
151+
release-macos:
152+
runs-on: macOS-latest
153+
154+
steps:
155+
- uses: olegtarasov/[email protected]
156+
id: get_version
157+
- uses: actions/checkout@v3
158+
- uses: dtolnay/rust-toolchain@stable
159+
with:
160+
targets: x86_64-apple-darwin
161+
- name: Environment Setup
162+
run: |
163+
export CFLAGS="-fno-stack-check"
164+
export MACOSX_DEPLOYMENT_TARGET="10.9"
165+
166+
- name: Build
167+
run: |
168+
cargo build --release --target x86_64-apple-darwin
169+
170+
- name: Prepare Package
171+
run: |
172+
mkdir -p ${{ env.binary }}.app/Contents/MacOS
173+
cp target/x86_64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/
174+
cp -r assets ${{ env.binary }}.app/Contents/MacOS/
175+
hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{ env.binary }}.dmg
176+
177+
- name: Upload binaries to artifacts
178+
uses: actions/upload-artifact@v3
179+
with:
180+
path: ${{ env.binary }}.dmg
181+
name: mac
182+
183+
- name: Upload binaries to release
184+
if: ${{ env.add_binaries_to_github_release == 'true' }}
185+
uses: svenstaro/upload-release-action@v2
186+
with:
187+
repo_token: ${{ secrets.GITHUB_TOKEN }}
188+
file: ${{ env.binary }}.dmg
189+
asset_name: ${{ env.binary }}-macos-${{ steps.get_version.outputs.tag }}.dmg
190+
tag: ${{ github.ref }}
191+
overwrite: true
192+
193+
check-if-upload-to-itch-is-configured:
194+
runs-on: ubuntu-latest
195+
outputs:
196+
should-upload: ${{ steps.check-env.outputs.has-itch-target }}
197+
steps:
198+
- id: check-env
199+
run: |
200+
if [[ -z "$itch_target" ]]; then
201+
echo "has-itch-target=no" >> $GITHUB_OUTPUT
202+
else
203+
echo "has-itch-target=yes" >> $GITHUB_OUTPUT
204+
fi
205+
206+
upload-to-itch:
207+
runs-on: ubuntu-latest
208+
needs:
209+
- check-if-upload-to-itch-is-configured
210+
- release-wasm
211+
- release-linux
212+
- release-windows
213+
- release-macos
214+
if: ${{ needs.check-if-upload-to-itch-is-configured.outputs.should-upload == 'yes' }}
215+
216+
steps:
217+
- name: Download artifacts
218+
uses: actions/download-artifact@v3
219+
with:
220+
path: ./builds
221+
222+
- name: Install butler
223+
run: |
224+
curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
225+
unzip butler.zip
226+
chmod +x butler
227+
./butler -V
228+
- uses: olegtarasov/[email protected]
229+
id: get_version
230+
- name: Upload to itch.io
231+
env:
232+
BUTLER_API_KEY: ${{ secrets.BUTLER_CREDENTIALS }}
233+
run: |
234+
for channel in $(ls builds); do
235+
./butler push \
236+
--fix-permissions \
237+
--userversion="${{ steps.get_version.outputs.tag }}" \
238+
builds/$channel/* \
239+
${{ env.itch_target }}:$channel
240+
done

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/target
2+
.vscode
3+
Cargo.lock

Cargo.toml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "scp087b_redux"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
bevy = { version = "0.14.1", features = ["jpeg", "wav"] }
8+
bevy_asset_loader = "0.21.0"
9+
bevy-inspector-egui = "0.25.2"
10+
rand = "0.8.5"
11+
bevy_rand = { version = "0.7.1", features = ["rand_chacha", "wyrand"] }
12+
bevy-panic-handler = "3.0.0"
13+
avian3d = "0.1.2"
14+
leafwing-input-manager = "0.15.0"

0 commit comments

Comments
 (0)