Skip to content

Commit c3cd47d

Browse files
committed
chore: building wasm target only
1 parent 0ee647a commit c3cd47d

File tree

3 files changed

+6
-218
lines changed

3 files changed

+6
-218
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 218 deletions
Original file line numberDiff line numberDiff line change
@@ -67,220 +67,6 @@ jobs:
6767
tag: ${{ github.ref }}
6868
overwrite: true
6969

70-
# Build for Linux
71-
release-linux:
72-
runs-on: ubuntu-latest
73-
74-
steps:
75-
- uses: olegtarasov/get-tag@v2.1.2
76-
id: get_version
77-
- uses: actions/checkout@v4
78-
with:
79-
lfs: ${{ env.use_git_lfs }}
80-
- name: Download assets
81-
run: |
82-
mkdir -p assets
83-
sudo apt-get update && sudo apt-get install -y megatools
84-
megatools dl --path assets https://mega.nz/folder/DOZ1HCTb#sD5HuQYbZpOx2hS0apSXhQ
85-
- uses: dtolnay/rust-toolchain@stable
86-
with:
87-
targets: x86_64-unknown-linux-gnu
88-
- name: install dependencies
89-
run: |
90-
sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libwayland-dev
91-
92-
- name: Build
93-
run: |
94-
cargo build --release --target x86_64-unknown-linux-gnu
95-
96-
- name: Prepare package
97-
run: |
98-
mkdir linux
99-
cp target/x86_64-unknown-linux-gnu/release/${{ env.binary }} linux/
100-
cp -r assets linux/ || true # Try to copy, but ignore if it can't copy if source directory does not exist
101-
102-
- name: Package as a zip
103-
working-directory: ./linux
104-
run: |
105-
zip --recurse-paths ../${{ env.binary }}.zip .
106-
107-
- name: Upload binaries to artifacts
108-
uses: actions/upload-artifact@v4
109-
with:
110-
path: ${{ env.binary }}.zip
111-
name: linux
112-
retention-days: 1
113-
114-
- name: Upload binaries to release
115-
if: ${{ env.add_binaries_to_github_release == 'true' }}
116-
uses: svenstaro/upload-release-action@v2
117-
with:
118-
repo_token: ${{ secrets.GITHUB_TOKEN }}
119-
file: ${{ env.binary }}.zip
120-
asset_name: ${{ env.binary }}-linux-${{ steps.get_version.outputs.tag }}.zip
121-
tag: ${{ github.ref }}
122-
overwrite: true
123-
124-
# Build for Windows
125-
release-windows:
126-
runs-on: windows-latest
127-
128-
steps:
129-
- uses: olegtarasov/get-tag@v2.1.2
130-
id: get_version
131-
- uses: actions/checkout@v4
132-
with:
133-
lfs: ${{ env.use_git_lfs }}
134-
- name: Download assets
135-
run: |
136-
mkdir assets
137-
Invoke-WebRequest -Uri https://mega.nz/MEGAcmdSetup64.exe -OutFile MEGAcmdSetup.exe
138-
Start-Process -FilePath .\MEGAcmdSetup.exe -ArgumentList '/S' -Wait
139-
mega-get https://mega.nz/folder/DOZ1HCTb#sD5HuQYbZpOx2hS0apSXhQ assets
140-
- uses: dtolnay/rust-toolchain@stable
141-
with:
142-
targets: x86_64-pc-windows-msvc
143-
144-
- name: Build
145-
run: |
146-
cargo build --release --target x86_64-pc-windows-msvc
147-
148-
- name: Prepare package
149-
run: |
150-
mkdir windows
151-
cp target/x86_64-pc-windows-msvc/release/${{ env.binary }}.exe windows/
152-
mkdir assets -ea 0 # create the assets directory if it does not exist, it will get ignored in the zip if empty
153-
cp -r assets windows/
154-
155-
- name: Package as a zip
156-
run: |
157-
Compress-Archive -Path windows/* -DestinationPath ${{ env.binary }}.zip
158-
159-
- name: Upload binaries to artifacts
160-
uses: actions/upload-artifact@v4
161-
with:
162-
path: ${{ env.binary }}.zip
163-
name: windows
164-
retention-days: 1
165-
166-
- name: Upload binaries to release
167-
if: ${{ env.add_binaries_to_github_release == 'true' }}
168-
uses: svenstaro/upload-release-action@v2
169-
with:
170-
repo_token: ${{ secrets.GITHUB_TOKEN }}
171-
file: ${{ env.binary }}.zip
172-
asset_name: ${{ env.binary }}-windows-${{ steps.get_version.outputs.tag }}.zip
173-
tag: ${{ github.ref }}
174-
overwrite: true
175-
176-
# Build for MacOS x86_64
177-
release-macOS-intel:
178-
runs-on: macOS-latest
179-
180-
steps:
181-
- uses: olegtarasov/get-tag@v2.1.2
182-
id: get_version
183-
- uses: actions/checkout@v4
184-
with:
185-
lfs: ${{ env.use_git_lfs }}
186-
- name: Download assets
187-
run: |
188-
mkdir -p assets
189-
curl -L -o MEGAcmd.dmg https://mega.nz/MEGAcmdSetup.dmg
190-
hdiutil attach MEGAcmd.dmg
191-
sudo installer -pkg /Volumes/MEGAcmd/MEGAcmd.pkg -target /
192-
hdiutil detach /Volumes/MEGAcmd
193-
mega-get https://mega.nz/folder/DOZ1HCTb#sD5HuQYbZpOx2hS0apSXhQ assets
194-
- uses: dtolnay/rust-toolchain@stable
195-
with:
196-
targets: x86_64-apple-darwin
197-
- name: Environment Setup
198-
run: |
199-
export CFLAGS="-fno-stack-check"
200-
export MACOSX_DEPLOYMENT_TARGET="10.9"
201-
202-
- name: Build
203-
run: |
204-
cargo build --release --target x86_64-apple-darwin
205-
206-
- name: Prepare Package
207-
run: |
208-
mkdir -p ${{ env.binary }}.app/Contents/MacOS
209-
cp target/x86_64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/
210-
cp -r assets ${{ env.binary }}.app/Contents/MacOS/ || true # Try to copy, but ignore if it can't copy if source directory does not exist
211-
hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{ env.binary }}-macOS-intel.dmg
212-
213-
- name: Upload binaries to artifacts
214-
uses: actions/upload-artifact@v4
215-
with:
216-
path: ${{ env.binary }}-macOS-intel.dmg
217-
name: macOS-intel
218-
retention-days: 1
219-
220-
- name: Upload binaries to release
221-
if: ${{ env.add_binaries_to_github_release == 'true' }}
222-
uses: svenstaro/upload-release-action@v2
223-
with:
224-
repo_token: ${{ secrets.GITHUB_TOKEN }}
225-
file: ${{ env.binary }}-macOS-intel.dmg
226-
asset_name: ${{ env.binary }}-macOS-intel-${{ steps.get_version.outputs.tag }}.dmg
227-
tag: ${{ github.ref }}
228-
overwrite: true
229-
230-
# Build for MacOS Apple Silicon
231-
release-macOS-apple-silicon:
232-
runs-on: macOS-latest
233-
234-
steps:
235-
- uses: olegtarasov/get-tag@v2.1.2
236-
id: get_version
237-
- uses: actions/checkout@v4
238-
with:
239-
lfs: ${{ env.use_git_lfs }}
240-
- name: Download assets
241-
run: |
242-
mkdir -p assets
243-
curl -L -o MEGAcmd.dmg https://mega.nz/MEGAcmdSetup.dmg
244-
hdiutil attach MEGAcmd.dmg
245-
sudo installer -pkg /Volumes/MEGAcmd/MEGAcmd.pkg -target /
246-
hdiutil detach /Volumes/MEGAcmd
247-
mega-get https://mega.nz/folder/DOZ1HCTb#sD5HuQYbZpOx2hS0apSXhQ assets
248-
- uses: dtolnay/rust-toolchain@stable
249-
with:
250-
targets: aarch64-apple-darwin
251-
- name: Environment
252-
# macOS 11 was the first version to support ARM
253-
run: |
254-
export MACOSX_DEPLOYMENT_TARGET="11"
255-
256-
- name: Build
257-
run: |
258-
cargo build --release --target aarch64-apple-darwin
259-
260-
- name: Prepare Package
261-
run: |
262-
mkdir -p ${{ env.binary }}.app/Contents/MacOS
263-
cp target/aarch64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/
264-
cp -r assets ${{ env.binary }}.app/Contents/MacOS/ || true # Try to copy, but ignore if it can't copy if source directory does not exist
265-
hdiutil create -fs HFS+ -volname "${{ env.binary }}-macOS-apple-silicon" -srcfolder ${{ env.binary }}.app ${{ env.binary }}-macOS-apple-silicon.dmg
266-
267-
- name: Upload binaries to artifacts
268-
uses: actions/upload-artifact@v4
269-
with:
270-
path: ${{ env.binary }}-macOS-apple-silicon.dmg
271-
name: macOS-apple-silicon
272-
retention-days: 1
273-
274-
- name: Upload binaries to release
275-
if: ${{ env.add_binaries_to_github_release == 'true' }}
276-
uses: svenstaro/upload-release-action@v2
277-
with:
278-
repo_token: ${{ secrets.GITHUB_TOKEN }}
279-
file: ${{ env.binary }}-macOS-apple-silicon.dmg
280-
asset_name: ${{ env.binary }}-macOS-apple-silicon-${{ steps.get_version.outputs.tag }}.dmg
281-
tag: ${{ github.ref }}
282-
overwrite: true
283-
28470
check-if-upload-to-itch-is-configured:
28571
runs-on: ubuntu-latest
28672
outputs:
@@ -299,10 +85,6 @@ jobs:
29985
needs:
30086
- check-if-upload-to-itch-is-configured
30187
- release-wasm
302-
- release-linux
303-
- release-windows
304-
- release-macOS-intel
305-
- release-macOS-apple-silicon
30688
if: ${{ needs.check-if-upload-to-itch-is-configured.outputs.should-upload == 'yes' }}
30789

30890
steps:

Cargo.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ bevy = { version = "0.18", features = ["dynamic_linking", "bevy_picking"] }
2222
shuftlib = "0.2"
2323
strum = { version = "0.27", features = ["derive"] }
2424

25+
[target.'cfg(target_arch = "wasm32")'.dependencies]
26+
getrandom = { version = "0.4", features = ["wasm_js"] }
27+
2528
[profile.dev]
2629
opt-level = 1
2730

0 commit comments

Comments
 (0)