Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bevy Rewrite #466

Merged
merged 222 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
222 commits
Select commit Hold shift + click to select a range
648729b
Bootstrap Bevy Game
zicklag Sep 24, 2022
51aa563
Fix Web Build Script
zicklag Sep 24, 2022
4634e19
Update CI
zicklag Sep 24, 2022
2a2dae2
Add Missing Cargo.toml Files That Were .gitignored
zicklag Sep 24, 2022
c269212
Setup Main Menu And Settings Menu
zicklag Sep 25, 2022
4d74900
Tile The Menu Background
zicklag Sep 25, 2022
fb557a6
Add Fairfax Font License
zicklag Sep 25, 2022
c778fe9
Start Player Select Menu
zicklag Sep 25, 2022
d189438
Start Map Select UI
zicklag Sep 26, 2022
72ff388
Move Jumpy Crate to Project Root Dir
zicklag Sep 26, 2022
4e31c79
Add Players to Player Select Menu
zicklag Sep 27, 2022
578f6a6
Fix Warning and Compile Error
zicklag Sep 27, 2022
d20341b
Add Rust Toolchain File
zicklag Sep 27, 2022
ae13bf9
Support JSON Extension for Assets
zicklag Sep 27, 2022
9d2dc4c
Fix Clippy Lints
zicklag Sep 27, 2022
7261525
Fix Player Select Continue Logic
zicklag Sep 27, 2022
1a6e787
Start Map Metadata
zicklag Sep 27, 2022
4941edf
Fix Menu Input System Scheduling
zicklag Sep 27, 2022
9ebe231
Work More on Map Metadata
zicklag Sep 27, 2022
862145b
Remove Old Commented Code
zicklag Sep 27, 2022
a3ea0d5
Add Menu Background Movement
zicklag Sep 28, 2022
e3ee36a
Fix Animated Menu Background on WASM
zicklag Sep 28, 2022
333ffe6
Start Editor UI
zicklag Sep 28, 2022
9e6dc9e
More Progress on Editor UI
zicklag Sep 28, 2022
3912c9a
Add Debug Plugin
zicklag Sep 29, 2022
0862356
Add Map Pan and Zoom to Editor
zicklag Sep 29, 2022
b7e9780
Add Missing Translations For Settings Menu
zicklag Sep 29, 2022
26d294e
Update Camera Viewport to Fit Inside of Editor
zicklag Sep 29, 2022
c196026
Allow Swapping Between Play and Edit Modes
zicklag Sep 29, 2022
3d980cf
Workaround Camera Viewport Bug in Bevy
zicklag Sep 29, 2022
11e4c67
Fix Resize Cursor for Right Sidebar
zicklag Sep 29, 2022
ed6b4ec
Cargo Update and Remove Script Type Workaround
zicklag Sep 29, 2022
6b94c23
Tweak UI Scale and Localization Organization
zicklag Sep 29, 2022
19c50f8
Localize Editor Sidebar
zicklag Sep 29, 2022
f7f4fc1
Remove Bevy Mod Raycast
zicklag Sep 29, 2022
355cd24
Add Missing Input Binding Message to Localization
zicklag Sep 30, 2022
0bfc278
Reorganize UI Widget Setup
zicklag Sep 30, 2022
4ebea56
Fix WASM Compile Error
zicklag Sep 30, 2022
0ad1957
Reorganize Editor With New Widget Trait
zicklag Sep 30, 2022
2bc1606
Add Editor View Reset Button and Stats
zicklag Sep 30, 2022
e10471f
Move More UI Logic into Plugins
zicklag Sep 30, 2022
74df923
Add Stubs for LinesPlugin and MapPlugin
zicklag Sep 30, 2022
2fba893
Remove Hud Module From Punchy
zicklag Sep 30, 2022
e885b25
Rename Trait to Use Proper Casing
zicklag Sep 30, 2022
4470d66
More UI Reorganization
zicklag Sep 30, 2022
be96e75
Use Hex Instead of Arrays for Colors In Metadata
zicklag Sep 30, 2022
d46bfc9
Add Map Grid Preview
zicklag Oct 2, 2022
12117dc
Add Show Grid Button And Hide Grid in Game
zicklag Oct 2, 2022
854fe33
Disable Sidebar When Map is Unloaded
zicklag Oct 2, 2022
b07b5bd
Add Layer Create Dialog and Layer List
zicklag Oct 3, 2022
b972629
Add Map Export Menu
zicklag Oct 3, 2022
2f38c40
Migrate Old Maps to New Format
zicklag Oct 3, 2022
8684f5e
Add Map Loading
zicklag Oct 3, 2022
a3b75c7
Fix Map Migrator
zicklag Oct 3, 2022
d1f291f
Rename Map Entities to Map Elements
zicklag Oct 3, 2022
b211c50
Add Placeholder Map Backgrounds
zicklag Oct 4, 2022
37eb778
Stub Out Map Elements and Use Render Layers
zicklag Oct 4, 2022
35b3a35
Add preload_assets Option to Map Elements
zicklag Oct 4, 2022
cc3339f
Fix UI Scaling and Editor Cleanup
zicklag Oct 5, 2022
4ef8628
Spawn Map Elements
zicklag Oct 5, 2022
d5f7dfa
Spawn Cameras at Game Startup
zicklag Oct 5, 2022
7182638
Switch Back go bevy_mod_js_scripting Master
zicklag Oct 5, 2022
ff90433
Update Rapier
zicklag Oct 5, 2022
41df4d8
Add Seaweed Item
zicklag Oct 6, 2022
76a9837
Add Anemonies Map Element
zicklag Oct 6, 2022
997df80
Move Map Elements Into Categories
zicklag Oct 6, 2022
f469a1d
Add Stub Elements For Missing Items
zicklag Oct 6, 2022
f1c1cb0
Tweak Item Placement in Map Migration Script
zicklag Oct 6, 2022
89f9fcd
Use Handle Ids Instead of Asset Path in Scripts
zicklag Oct 6, 2022
2fc847b
Add Close and Reload Buttons To Editor Toolbar
zicklag Oct 6, 2022
3320e40
Setup Rapier Debug Rendering Plugin
zicklag Oct 6, 2022
5952cf2
Spawn Tile Collision Shapes and Tweak Debug Render
zicklag Oct 7, 2022
6da8192
Reorganize Animated Sprite Systems
zicklag Oct 7, 2022
36726e1
Add Placeholder Crabs
zicklag Oct 7, 2022
5e033f7
Add Web Deployment to CI
zicklag Oct 7, 2022
8d49d7d
Decentralize Anemones And Seaweed Spritesheet
zicklag Oct 7, 2022
5c1cb8d
Add Start to Physics
zicklag Oct 8, 2022
a770f89
Fix Debug Render Frame Lagging Behind Colliders
zicklag Oct 8, 2022
ea70dad
Add Name Plugin
zicklag Oct 8, 2022
00c9bf0
Tweak Entity Names
zicklag Oct 8, 2022
bc9d5b6
Add a Script State and Info Helper
zicklag Oct 9, 2022
f48cf19
Port the Old Jumpy Physics
zicklag Oct 9, 2022
38a9f35
Fix Sub-Pixel Offset in Map Collisions
zicklag Oct 10, 2022
b3f30ea
Implement Basic Crab Walk Logic
zicklag Oct 10, 2022
9943647
Run Scripts in Fixed Updates
zicklag Oct 10, 2022
ad0dbc5
Add FixedUpdate InGame Stages
zicklag Oct 10, 2022
4a13aa9
Implement Debug Drawing for Colliders
zicklag Oct 10, 2022
962f1fc
Implement Player Input and Expose to Scripts
zicklag Oct 11, 2022
56b089d
Move Player Input to It's Own Module
zicklag Oct 11, 2022
ab8086e
Fix Collision Debug Shape Cleanup
zicklag Oct 11, 2022
946100c
Add Player Spawning
zicklag Oct 11, 2022
2089fbb
Change Lots of Stuff
zicklag Oct 12, 2022
df6dd75
Add Average FPS and Frame Time to Diagnostics
zicklag Oct 13, 2022
274b15e
Fix Physics For Actors Larger Than Tiles
zicklag Oct 13, 2022
47b5695
Have ScriptInfo Op Initialize Uninitialized Refs
zicklag Oct 13, 2022
ffd4976
Start on Player State Management
zicklag Oct 14, 2022
548bba5
Get an Extra Bit Out of JS Hash
zicklag Oct 14, 2022
48dd53a
Reorganize Some Assets
zicklag Oct 14, 2022
7307836
Update bevy_mod_js_scripting to Fix Native Build
zicklag Oct 14, 2022
9c296ce
Use Built-in Setting to Match Web Screen Size
zicklag Oct 14, 2022
bfef481
Add Camera Controller
zicklag Oct 14, 2022
1dc6754
Remove Unused Component From Camera Controller
zicklag Oct 14, 2022
2fbb5ec
Add Age to Player State
zicklag Oct 14, 2022
01e17b2
Add Animation Bank Sprites and Add to Player
zicklag Oct 15, 2022
b5737fa
Add Idle, Midair, and Walk States
zicklag Oct 15, 2022
58dbe28
Make HandleId Hashes Strings to Capture 64 Bits
zicklag Oct 15, 2022
765077f
Fix Some Script Errors in the Console
zicklag Oct 15, 2022
2de0836
Fix Incorrect Type Annotation in Reflect Function
zicklag Oct 15, 2022
715f416
Fix Player Animations And Some Script Errors
zicklag Oct 15, 2022
ef1b4ff
Fix Bug With Animation Flip Changing
zicklag Oct 15, 2022
de17b06
Remove Active Player Hack
zicklag Oct 16, 2022
7a5107b
Fix "Just Pressed" Detection Frame Rates < 60fps
zicklag Oct 16, 2022
5f83a47
Don't Spawn Players on Top of Each-other
zicklag Oct 16, 2022
ccf930b
Fix Occasional Error in Crab Script
zicklag Oct 16, 2022
9836ea4
Remove Zoom From Camera Controller
zicklag Oct 16, 2022
21a8b9a
Start on Network Sync
zicklag Oct 17, 2022
3e52212
Fix Web Compile
zicklag Oct 17, 2022
ab9d5a7
Use Network Serializable AssetHandle Wrapper
zicklag Oct 17, 2022
49124d5
Implement Server-side of Frame Sync
zicklag Oct 18, 2022
3dbd783
Add ( Untested ) Code For Client Frame Sync
zicklag Oct 18, 2022
3dd19e6
Ultra Work-in-Progress Networking Stuff
zicklag Oct 18, 2022
266e4cd
Add Server Network Visualizer
zicklag Oct 19, 2022
6d9be1d
Implement Custom Compact Serializer
zicklag Oct 20, 2022
6aca784
Rename NetworkSyncQueries to NetworkSyncConfig
zicklag Oct 20, 2022
0b35411
Don't Use NetCommands to Spawn Map Elements
zicklag Oct 20, 2022
05d8148
Don't Sync Crabs Over Network
zicklag Oct 20, 2022
4a84425
Fix Network Resource Insert Command
zicklag Oct 21, 2022
20b5c19
Start on Matchmaker Server
zicklag Oct 22, 2022
c3af228
Fix Client/Server Flow For Matchmaker
zicklag Oct 22, 2022
6e3eec9
Finish Basic Matchmaking
zicklag Oct 22, 2022
ac9972a
Keep Matchmaker Connection Alive at the Server
zicklag Oct 22, 2022
51eecba
Remove ConnectionMode and Separate Game Modules
zicklag Oct 22, 2022
15c6ba9
Setup Dynamic Game Servers In Matchmaker
zicklag Oct 23, 2022
fdbf3a5
Fix WASM Build
zicklag Oct 23, 2022
1152935
Fix First Room Join Bug And Add Server Asset Path
zicklag Oct 23, 2022
7d017c8
Set Matchmaker Thread Pool Max
zicklag Oct 23, 2022
f1e13ea
Start on Server API for in Game
zicklag Oct 23, 2022
b498926
Add Client Implementation
zicklag Oct 23, 2022
fbde593
Finish Off NetServer/Client Foundation
zicklag Oct 24, 2022
8feea99
Fix Web Compile
zicklag Oct 24, 2022
eab7f26
Refactor NetServer and NetClient
zicklag Oct 24, 2022
f5d1444
Update Ping System
zicklag Oct 24, 2022
222ddc9
Fix Server Run Mode
zicklag Oct 24, 2022
56d89b4
Start on Matchmaking Menu and Add Player Count API
zicklag Oct 24, 2022
58865c6
Connect to Matchmaking Server in Game UI
zicklag Oct 25, 2022
4abb597
Fix Web Compile
zicklag Oct 25, 2022
69d86ee
Improve Matchmaking Interface
zicklag Oct 25, 2022
e2c2e28
Implement Network Game Player Selection
zicklag Oct 25, 2022
9e50f63
Implement Online Map Selection
zicklag Oct 26, 2022
185733b
Rename Matchmaker Crate
zicklag Oct 26, 2022
8952965
Bring Back Net Frame Sync and NetCommands
zicklag Oct 26, 2022
dd558e1
Add Player Input Sync
zicklag Oct 26, 2022
e94e2aa
Get Closer to Working Network Sync
zicklag Oct 26, 2022
72de976
Get Basic Network Sync "Working"
zicklag Oct 26, 2022
d619869
Remove WASM Connection Shim
zicklag Oct 26, 2022
0a31aeb
Remove Old Debugging Log Msg
zicklag Oct 26, 2022
b97f946
Allow Retrying Failed Matchmaking
zicklag Oct 26, 2022
fa0f580
Switch to Simple "Client Own Player" Networking
zicklag Oct 27, 2022
77899a4
Get Multiplayer Working! 🎉
zicklag Oct 27, 2022
7395002
Add Lerping For Remote Player Positions
zicklag Oct 27, 2022
ccb29b7
Clean Up Old Networking Modules
zicklag Oct 27, 2022
03bc0b2
Fix Player Control Selection for Network Games
zicklag Oct 28, 2022
976b89a
Update Release Workflow to Include Main Branch
zicklag Oct 28, 2022
5a1e553
Try to Fix Release Action
zicklag Oct 28, 2022
0c45595
Add Matchmaker Docker Build
zicklag Oct 28, 2022
d28bc63
Update Matchmaker Container Name
zicklag Oct 29, 2022
1d66004
Add Deploy Hook to Container Release
zicklag Oct 29, 2022
946ade9
Update Clap
zicklag Oct 29, 2022
0fbf15e
Make Matchmaking Server a Configurable Setting
zicklag Oct 29, 2022
dd2c14d
Temporarily Disable Web Build in CI
zicklag Oct 29, 2022
772b2c0
Fix Local Games
zicklag Oct 29, 2022
ab7c2cb
Allow Pressing Start to Continue From Player Select
zicklag Oct 29, 2022
350e796
Improve Map Select Slightly
zicklag Oct 29, 2022
05c9d3d
Improve Player Select Gamepad Navigation
zicklag Oct 29, 2022
2578f37
Implement Jump-through Platforms
zicklag Oct 29, 2022
9c9d81f
Don't Go to Map Select Before Player Selected
zicklag Oct 29, 2022
f054244
Don't Run Player State Transitions During Pause
zicklag Oct 29, 2022
6464ca8
Tweak Networking Settings Widget Adjacencies
zicklag Oct 30, 2022
f6b1153
Allow Continuing Player Select With Enter
zicklag Oct 30, 2022
10680c0
Add Initial Sword Spawning
zicklag Oct 30, 2022
1139844
Try to Fix Some of the Map Item Positioning
zicklag Oct 30, 2022
c59b975
Add Actor Collision Detection Helper
zicklag Oct 30, 2022
b94e278
Implement Crouch State
zicklag Oct 30, 2022
cbea628
Kill Out of Bounds Players
zicklag Oct 30, 2022
92b5b56
Tweak Player Controller
zicklag Oct 30, 2022
f2319e4
Add CollisionWorld Script Namespace
zicklag Oct 30, 2022
d1713cf
Clean-up Some Old TODOs
zicklag Oct 30, 2022
8ef5119
Add Restart Button To Pause Menu
zicklag Oct 31, 2022
2309100
Start Player Inventory and Items
zicklag Oct 31, 2022
b4958e2
Net Sync Item Grab/Drop
zicklag Oct 31, 2022
93a1905
Fix Net Sync Item Grab and Drop Events
zicklag Oct 31, 2022
066aaa8
Align Sword With Player When Held
zicklag Nov 1, 2022
2baaf1b
Prevent Items From Getting Stuck in Walls
zicklag Nov 1, 2022
05d1bfe
Sync Player Velocities and Fix Item Drop Sync
zicklag Nov 1, 2022
2c8e41d
Revert "Sync Player Velocities and Fix Item Drop Sync"
zicklag Nov 1, 2022
84daab2
Fix Item Throwing Velocity Sync
zicklag Nov 1, 2022
bec8310
Implement Item Use and Sword Swing
zicklag Nov 1, 2022
a48ef41
Fix Rustdoc Warnings
zicklag Nov 1, 2022
69992f3
First Working Item: Sword 🎉
zicklag Nov 2, 2022
d3e86b3
Use Global Transform for Damage Region
zicklag Nov 2, 2022
189cf7c
Implement Player Death State
zicklag Nov 2, 2022
8e5004d
Add Death Animations For Remaining Fish
zicklag Nov 2, 2022
b6486f3
Show "Online/Local Game" In Player Select Screen
zicklag Nov 3, 2022
0930502
Polish Sword Item Implementation
zicklag Nov 3, 2022
9540580
Fix Death Animation Freezing in Midair
zicklag Nov 3, 2022
b3d15ae
Clean up dead.ts State
zicklag Nov 3, 2022
29324dd
Remove Redundant Type Declarationsin Decorations
zicklag Nov 4, 2022
7d71176
Fix Redundant Sword Damage Regions
zicklag Nov 4, 2022
55a2cbd
Add Sproingers
zicklag Nov 4, 2022
26b0d5a
Make Player Collisions Skinnier
zicklag Nov 4, 2022
bd9f8c4
Fix Sharky's Death Animation
zicklag Nov 4, 2022
bf44402
Un-Vendor `normalize_path` Crate
zicklag Nov 4, 2022
151503e
Fix Item Event Handling
zicklag Nov 4, 2022
905ff51
Make Sure Sword Only Updates Sword Items
zicklag Nov 4, 2022
ffa6d7a
Add Placeholder Bomb Item
zicklag Nov 4, 2022
6d49707
Throwable Kick Bombs
zicklag Nov 4, 2022
a92ad0f
Only Run Web Demo Build on Manual Trigger
zicklag Nov 4, 2022
2be5567
Disable WASM Clippy in CI
zicklag Nov 4, 2022
d22664f
Format Rust Code
zicklag Nov 4, 2022
ee90eac
Install Necessary Components in CI Workflow
zicklag Nov 4, 2022
12daa1b
Update Status in README
zicklag Nov 4, 2022
58fea02
Add Warning to Book About Out-of-Date Docs
zicklag Nov 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
/web-target
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig file: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false

[*.ts]
indent_size = 2

[*.yaml]
indent_size = 2

[*.yml]
indent_size = 2
67 changes: 67 additions & 0 deletions .github/workflows/build-matchmaker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#
# Builds the matchmaking server docker image
#
name: Build & Publish Matchmaker Docker Image

on:
push:
branches:
- main
tags:
- "v*"

env:
RELEASE_VERSION: ${{ github.ref_name }}

jobs:
build-and-publish:
name: Build and Publish Container
runs-on: ubuntu-latest
env:
DEPLOY_HOOK: ${{ secrets.DEPLOY_HOOK }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/${{ github.repository }}-matchmaker

# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Re-deploy Container
run: |
$DEPLOY_HOOK
106 changes: 41 additions & 65 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,94 +1,70 @@
name: Continuous integration
name: CI

on:
push:
branches:
- main
paths-ignore:
- "**.md"
- "**.json"
- master
- staging
- trying
pull_request:
paths-ignore:
- "**.md"
- "**.json"

jobs:
fmt:
check_formatting:
runs-on: ubuntu-latest
name: Formatting
name: Check Rust formatting
steps:
- uses: actions/checkout@v2
- name: Check Rust formatting
uses: actions-rs/cargo@v1
- uses: actions/checkout@v3
- name: Install Rustfmt
uses: actions-rs/toolchain@v1
with:
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
clippy_correctness_checks:
runs-on: ubuntu-latest
name: Linting
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install \
--allow-unauthenticated -y -qq \
libasound2-dev \
libgl1-mesa-dev \
libx11-dev \
libxi-dev \
libudev-dev
- name: Install Clippy
run: rustup component add clippy

- name: Run Clippy
run: cargo clippy -- -W clippy::correctness -D warnings

build:
name: Build
runs-on: ${{ matrix.config.os }}
name: Clippy correctness checks
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, target: "x86_64-unknown-linux-gnu" }
- { os: macos-latest, target: "x86_64-apple-darwin" }
- { os: macos-latest, target: "aarch64-apple-darwin" }
- { os: windows-latest, target: "x86_64-pc-windows-msvc" }
- { os: windows-latest, target: "i686-pc-windows-msvc" }
profile: ["--release"]

- { target: 'x86_64-unknown-linux-gnu', target_dir: 'target' }
# Disable WASM Target until we fix WASM compile
# - { target: 'wasm32-unknown-unknown', target_dir: 'web-target' }
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install \
--allow-unauthenticated -y -qq \
sudo apt-get install -y -q \
libasound2-dev \
libgl1-mesa-dev \
libx11-dev \
libxi-dev \
libudev-dev
- name: Cache Cargo dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Setup Rust
- uses: actions/checkout@v3
- name: Install WASM Target
if: matrix.config.target == 'wasm32-unknown-unknown'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
target: ${{ matrix.config.target }}
components: clippy
- name: Install Clippy
if: matrix.config.target != 'wasm32-unknown-unknown'
uses: actions-rs/toolchain@v1
with:
components: clippy
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
web-target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/cargo@v1
env:
CARGO_TARGET_DIR: ${{ matrix.config.target_dir }}
with:
command: build
args: --locked --target ${{ matrix.config.target }} ${{ matrix.profile }}
command: clippy
args: --target ${{ matrix.config.target }} -- -W clippy::correctness -D warnings
74 changes: 35 additions & 39 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# This action will generate Windows|Linux|MacOS binary releases

name: Release
name: CD

on:
push:
branches:
- main
tags:
- "v*"
- 'v*'

env:
RELEASE_VERSION: ${{ github.ref_name }}

jobs:
build_release:
Expand All @@ -16,38 +19,31 @@ jobs:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, target: "x86_64-unknown-linux-gnu" }
- { os: macos-latest, target: "x86_64-apple-darwin" }
- { os: macos-latest, target: "aarch64-apple-darwin" }
- { os: windows-latest, target: "x86_64-pc-windows-msvc" }
- { os: windows-latest, target: "i686-pc-windows-msvc" }
- { os: ubuntu-latest, target: 'x86_64-unknown-linux-gnu' }
- { os: macos-latest, target: 'x86_64-apple-darwin' }
- { os: macos-latest, target: 'aarch64-apple-darwin' }
- { os: windows-latest, target: 'x86_64-pc-windows-msvc' }

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

- name: Set the release version
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
uses: actions/checkout@v3

- name: Install dependencies
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install \
--allow-unauthenticated -y -qq \
sudo apt-get install -y -q \
libasound2-dev \
libgl1-mesa-dev \
libx11-dev \
libxi-dev \
libudev-dev

- name: Cache Cargo
uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Setup Rust
Expand All @@ -60,9 +56,6 @@ jobs:

- name: Build
uses: actions-rs/cargo@v1
env:
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
RUSTFLAGS: -L /usr/lib/x86_64-linux-gnu
with:
command: build
args: --release --locked --target ${{ matrix.config.target }}
Expand All @@ -76,10 +69,8 @@ jobs:
echo "ARTIFACT_PATH=$artifact_path" >> $GITHUB_ENV
mkdir $release_dir
cp target/${{ matrix.config.target }}/release/jumpy.exe $release_dir/
strip $release_dir/jumpy.exe
find assets -name "*.schema.json" -exec rm -f {} \;
cp -R assets/ mods/ licenses/ $release_dir/
cp LICENSE $release_dir/licenses/
cp -R assets/ $release_dir/
cp LICENSE $release_dir/
7z a -tzip $artifact_path $release_dir/

- name: Prepare artifacts [Unix]
Expand All @@ -91,10 +82,8 @@ jobs:
echo "ARTIFACT_PATH=$artifact_path" >> $GITHUB_ENV
mkdir $release_dir
cp target/${{ matrix.config.target }}/release/jumpy $release_dir/
strip $release_dir/jumpy || true
find assets -name "*.schema.json" -exec rm -f {} \;
cp -R assets mods licenses $release_dir
cp LICENSE $release_dir/licenses
cp -R assets $release_dir
cp LICENSE $release_dir
tar -czvf $artifact_path $release_dir/

- name: Deploy | Upload artifacts
Expand All @@ -111,14 +100,20 @@ jobs:

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

- name: Download Artifacts
uses: actions/download-artifact@v2

- name: Set the release version
- name: Set stable release name
shell: bash
if: env.release_VERSION != 'main'
run: echo "RELEASE_NAME=Jumpy ${GITHUB_REF:10}" >> $GITHUB_ENV

- name: Set pre-release name
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
if: env.release_VERSION == 'main'
run: echo "RELEASE_NAME=Jumpy Dev Snapshot" >> $GITHUB_ENV

- name: Generate Checksums
run: for file in jumpy-*/jumpy-*; do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done
Expand All @@ -130,6 +125,7 @@ jobs:
file: jumpy-*/jumpy-*
file_glob: true
overwrite: true
body: "Fish Folk: Jumpy ${{ env.RELEASE_VERSION }} 🐟"
prerelease: ${{ env.RELEASE_VERSION == 'main' }}
body: '${{ env.RELEASE_NAME }}'
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 0 additions & 26 deletions .github/workflows/validation.yml

This file was deleted.

Loading