Skip to content

Commit

Permalink
test: ci windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamtowards committed Jan 19, 2024
1 parent 3e5d384 commit bacb5ec
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 47 deletions.
78 changes: 31 additions & 47 deletions .github/workflows/build_linux_release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rust
name: Build for Linux

on:
push:
Expand Down Expand Up @@ -30,32 +30,19 @@ jobs:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y mingw-w64 gcc-mingw-w64 g++-mingw-w64 zip
sudo apt-get install g++ pkg-config libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0
sudo apt-get install libwayland-dev libxkbcommon-dev # Wayland
rustup target add x86_64-apple-darwin
#rustup target add x86_64-pc-windows-msvc # Windows
#cargo install xwin
#xwin --accept-license splat --output ./.xwin
- name: Build for macOS
run: cargo build --release --target=x86_64-apple-darwin
sudo apt-get install libwayland-dev libxkbcommon-dev
# sudo apt-get install -y mingw-w64 gcc-mingw-w64 g++-mingw-w64 zip
# rustup target add x86_64-apple-darwin
# rustup target add x86_64-pc-windows-msvc # Windows
# cargo install xwin
# xwin --accept-license splat --output ./.xwin

- name: Build for Linux
run: cargo build --release

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
This is the release of ${APP_NAME}.
draft: false
prerelease: false
# - name: Build for macOS
# run: cargo build --release --target=x86_64-apple-darwin

- name: Upload Artifacts
uses: actions/upload-release-asset@v1
Expand All @@ -64,31 +51,28 @@ jobs:
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/release/${APP_NAME}
asset_name: ${APP_NAME}-linux-amd64
asset_content_type: application/octet-stream

- name: Upload Artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/x86_64-pc-windows-gnu/release/${APP_NAME}.exe
asset_name: ${APP_NAME}-windows-amd64.exe
asset_content_type: application/octet-stream

- name: Upload Artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/x86_64-apple-darwin/release/${APP_NAME}
asset_name: ${APP_NAME}-darwin-amd64
asset_name: ${APP_NAME}-linux-x86_64
asset_content_type: application/octet-stream

- name: Zip Windows Artifact
run: zip ${APP_NAME}-windows-amd64.zip ./target/x86_64-pc-windows-gnu/release/${APP_NAME}.exe
# - name: Upload Artifacts
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./target/x86_64-apple-darwin/release/${APP_NAME}
# asset_name: ${APP_NAME}-darwin-amd64
# asset_content_type: application/octet-stream

- name: Zip macOS Artifact
run: zip ${APP_NAME}-macos-amd64.zip ./target/x86_64-apple-darwin/release/${APP_NAME}
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# body: |
# This is the release of ${APP_NAME}.
# draft: false
# prerelease: false
64 changes: 64 additions & 0 deletions .github/workflows/build_windows_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build for Windows

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: windows-latest

env:
APP_NAME: ethertia

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, rust-src, clippy

- name: Install Dependencies
run: |
#rustup target add x86_64-pc-windows-msvc # Windows
- name: Build for Windows
run: |
cargo build --release --target x86_64-pc-windows-msvc
- name: Zip Windows Artifact
run: zip ${APP_NAME}-windows-x86_64.zip ./target/x86_64-pc-windows-msvc/release/${APP_NAME}.exe

- name: Upload Artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/x86_64-pc-windows-msvc/release/${APP_NAME}.exe
asset_name: ${APP_NAME}-windows-x86_64.exe
asset_content_type: application/octet-stream

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
This is the release of ${APP_NAME}.
draft: false
prerelease: false


1 change: 1 addition & 0 deletions src/voxel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ impl Plugin for VoxelPlugin {
(
chunks_remesh,
chunks_detect_load_and_unload,
gizmos,
// chunks_apply_loaded
// chunks_apply_remeshed
)
Expand Down

0 comments on commit bacb5ec

Please sign in to comment.