diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6c5813e..2da09e8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -42,7 +42,7 @@ jobs: - name: Prepare package run: | wasm-bindgen --no-typescript --out-name bevy_game --out-dir wasm --target web target/wasm32-unknown-unknown/release/${{ env.binary }}.wasm - cp -r assets wasm/ + cp -r assets wasm/ || true # Try to copy, but ignore if it can't copy if source directory does not exist - name: Package as a zip working-directory: ./wasm @@ -91,7 +91,7 @@ jobs: run: | mkdir linux cp target/x86_64-unknown-linux-gnu/release/${{ env.binary }} linux/ - cp -r assets linux/ + cp -r assets linux/ || true # Try to copy, but ignore if it can't copy if source directory does not exist - name: Package as a zip working-directory: ./linux @@ -137,6 +137,7 @@ jobs: run: | mkdir windows cp target/x86_64-pc-windows-msvc/release/${{ env.binary }}.exe windows/ + mkdir assets -ea 0 # create the assets directory if it does not exist, it will get ignored in the zip if empty cp -r assets windows/ - name: Package as a zip @@ -186,7 +187,7 @@ jobs: run: | mkdir -p ${{ env.binary }}.app/Contents/MacOS cp target/x86_64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/ - cp -r assets ${{ env.binary }}.app/Contents/MacOS/ + 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 hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{ env.binary }}-macOS-intel.dmg - name: Upload binaries to artifacts @@ -232,7 +233,7 @@ jobs: run: | mkdir -p ${{ env.binary }}.app/Contents/MacOS cp target/aarch64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/ - cp -r assets ${{ env.binary }}.app/Contents/MacOS/ + 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 hdiutil create -fs HFS+ -volname "${{ env.binary }}-macOS-apple-silicon" -srcfolder ${{ env.binary }}.app ${{ env.binary }}-macOS-apple-silicon.dmg - name: Upload binaries to artifacts diff --git a/README.md b/README.md index 2c4095d..db09b70 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ This workflow runs on every tag. It will build: * For Linux and Windows, a .zip archive containing the executable and the `assets`. -* For macOS, a dmg image with a .app containing the assets. -* For wasm, a .zip archive with the wasm binary, the js bindings, an html file loading it, and the assets. +* For macOS, a dmg image with a .app containing the `assets`. +* For wasm, a .zip archive with the wasm binary, the js bindings, an html file loading it, and the `assets`. If you don't want to target some of those platforms, you can remove the corresponding job from the file [release.yaml](./.github/workflows/release.yaml). @@ -67,11 +67,8 @@ If you would like to use the GitHub workflows included here for your own project 1. The release workflow relies on the `index.html` file under `/wasm` for web builds 2. Make sure that the env variable `binary` ([release.yaml](.github/workflows/release.yaml#L10)) matches the name of your binary -3. In case your project doesn't have an `assets` folder - 1. Either create one and put a `.gitkeep` file in it to be able to push it - 2. Or remove the `cp -r assets` statements in the build jobs -4. Adapt the used toolchain if you are using nightly -5. In your GitHub repo's settings, under `Actions -> General` make sure "Read and Write permissions" is selected under "Workflow permissions" near the bottom. This fixes the error `Error: Resource not accessible by integration`. +3. Adapt the used toolchain if you are using nightly +4. In your GitHub repo's settings, under `Actions -> General` make sure "Read and Write permissions" is selected under "Workflow permissions" near the bottom. This fixes the error `Error: Resource not accessible by integration`. ### Publish on itch.io