Skip to content

[game] Lua refactor (#103) #195

[game] Lua refactor (#103)

[game] Lua refactor (#103) #195

Workflow file for this run

name: Game Installer
on:
push:
branches: [master, windows-portable]
jobs:
bundle:
strategy:
matrix:
os:
- name: ubuntu-latest
artifact: target/**/*.deb
- name: macos-latest
artifact: "*.tar"
- name: macos-13
artifact: "*.tar"
runs-on: ${{matrix.os.name}}
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: cargo install --git https://github.com/burtonageo/cargo-bundle
- name: Install Packages
if: ${{ matrix.os.name == 'ubuntu-latest' }}
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libsoundtouch-dev libegl1-mesa-dev libfreetype6-dev zlib1g-dev libgtk-3-dev libudev-dev
- run: cargo bundle --release
- run: cargo bundle --release --bin kson-editor
- run: tar --strip-components 4 -cvf ${{ runner.os }}-${{ runner.arch }}.tar target/release/bundle/osx
if: ${{ runner.os == 'macOS' }}
- name: Upload to R2
working-directory: ${{ github.workspace }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_API_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_API_TOKEN }}
AWS_DEFAULT_REGION: weur
run: aws s3 sync . s3://${{ secrets.R2_BUCKET }}/${{ github.ref_name }} --endpoint-url ${{ secrets.S3_ENDPOINT }} --exclude "*" --include "*.tar" --include "*.deb"
continue-on-error: true
- uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-${{ runner.arch }}-Bundle
path: ${{ matrix.os.artifact }}
windows_installer:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: cargo install cargo-wix
- run: cargo wix -p rusc --nocapture
- name: Upload to R2
working-directory: ${{ github.workspace }}/target/wix
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_API_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_API_TOKEN }}
AWS_DEFAULT_REGION: weur
run: aws s3 sync . s3://${{ secrets.R2_BUCKET }}/${{ github.ref_name }} --endpoint-url ${{ secrets.S3_ENDPOINT }} --exclude "*" --include "*.msi"
continue-on-error: true
- uses: actions/upload-artifact@v4
with:
name: Windows installer
path: target/**/*.msi
windows_portable:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-portable-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: cargo build --release --features portable
- name: Make zip
shell: pwsh
run: |
mkdir kson-win-portable
Copy-Item ${{ github.workspace }}/game/fonts -Destination ${{ github.workspace }}/kson-win-portable -Recurse
Copy-Item ${{ github.workspace }}/game/skins -Destination ${{ github.workspace }}/kson-win-portable -Recurse
Copy-Item ${{ github.workspace }}/target/release/rusc.exe -Destination ${{ github.workspace }}/kson-win-portable
Copy-Item ${{ github.workspace }}/target/release/kson-editor.exe -Destination ${{ github.workspace }}/kson-win-portable
Compress-Archive -Path ${{ github.workspace }}/kson-win-portable -DestinationPath ${{ github.workspace }}/kson-win-portable.zip
- name: Upload to R2
working-directory: ${{ github.workspace }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_API_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_API_TOKEN }}
AWS_DEFAULT_REGION: weur
run: aws s3 sync . s3://${{ secrets.R2_BUCKET }}/${{ github.ref_name }} --endpoint-url ${{ secrets.S3_ENDPOINT }} --exclude "*" --include "*.zip"
continue-on-error: true
- uses: actions/upload-artifact@v4
with:
name: Windows portable
path: ${{ github.workspace }}/kson-win-portable.zip