Update test.yml #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload Release Assets | |
on: | |
push: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
release-linux: | |
name: Upload Release Assets | |
runs-on: ubuntu-latest | |
env: | |
BEVY_ASSET_PATH: "/project/kodecks-bevy/assets" | |
strategy: | |
matrix: | |
toolchain: [x86_64-unknown-linux-gnu] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install cargo-binstall | |
uses: cargo-bins/[email protected] | |
- name: Install cross | |
run: cargo binstall cross --force -y | |
- name: Download assets | |
run: ./scripts/download.sh | |
- name: Build project | |
run: cross build -p kodecks-bevy -p kodecks-server --profile distribution --features embed_assets --target ${{ matrix.toolchain }} | |
- name: Make archive | |
run: tar -C target/${{ matrix.toolchain }}/distribution -Jcvf kodecks-${{ matrix.toolchain }}.tar.xz kodecks | |
- name: Make archive | |
run: tar -C target/${{ matrix.toolchain }}/distribution -Jcvf kodecks-server-${{ matrix.toolchain }}.tar.xz kodecks-server | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release create ${{ github.ref_name }} --generate-notes --draft | |
continue-on-error: true | |
- name: Upload archive | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release upload ${{ github.ref_name }} *.tar.* | |
release-macos: | |
name: Upload Release Assets (macOS) | |
runs-on: macos-latest | |
env: | |
BEVY_ASSET_PATH: ${{ github.workspace }}/kodecks-bevy/assets | |
strategy: | |
matrix: | |
toolchain: [aarch64-apple-darwin] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
target: ${{ matrix.toolchain }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Download assets | |
run: ./scripts/download.sh | |
- name: Build project | |
run: cargo build -p kodecks-bevy -p kodecks-server --profile distribution --features embed_assets --target ${{ matrix.toolchain }} | |
- name: Make archive | |
run: tar -C target/${{ matrix.toolchain }}/distribution -Jcvf kodecks-${{ matrix.toolchain }}.tar.xz kodecks | |
- name: Make archive | |
run: tar -C target/${{ matrix.toolchain }}/distribution -Jcvf kodecks-server-${{ matrix.toolchain }}.tar.xz kodecks-server | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release create ${{ github.ref_name }} --generate-notes --draft | |
continue-on-error: true | |
- name: Upload archive | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release upload ${{ github.ref_name }} *.tar.* | |
release-windows: | |
name: Upload Release Assets (Windows) | |
runs-on: windows-latest | |
env: | |
BEVY_ASSET_PATH: ${{ github.workspace }}/kodecks-bevy/assets | |
strategy: | |
matrix: | |
toolchain: [x86_64-pc-windows-msvc] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
target: ${{ matrix.toolchain }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Download assets | |
run: scripts/download.ps1 | |
- name: Build project | |
run: cargo build -p kodecks-bevy -p kodecks-server --profile distribution --features embed_assets --target ${{ matrix.toolchain }} | |
- name: Make archive | |
run: tar -C target/${{ matrix.toolchain }}/distribution -acf kodecks-${{ matrix.toolchain }}.zip kodecks.exe | |
- name: Make archive | |
run: tar -C target/${{ matrix.toolchain }}/distribution -acf kodecks-server-${{ matrix.toolchain }}.zip kodecks-server.exe | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release create ${{ github.ref_name }} --generate-notes --draft | |
continue-on-error: true | |
- name: Upload archive | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release upload ${{ github.ref_name }} kodecks-${{ matrix.toolchain }}.zip kodecks-server-${{ matrix.toolchain }}.zip |