Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
tryuan99 committed Sep 28, 2024
2 parents e77f6b5 + 08d6b41 commit bb05531
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 18 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/builder.yaml → .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: Build project
name: Build

on:
push:
branches:
- release
pull_request:
branches:
- release
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
buildForAllSupportedPlatforms:
Expand Down Expand Up @@ -36,13 +33,20 @@ jobs:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
buildName: micromissiles-${{ github.run_number }}-${{ matrix.targetPlatform }}
buildName: micromissiles-${{ github.ref_name }}-${{ matrix.targetPlatform }}
versioning: Semantic
targetPlatform: ${{ matrix.targetPlatform }}
- name: Make build output readable and executable
run: |
sudo chmod -R 777 build/${{ matrix.targetPlatform }}
- uses: actions/upload-artifact@v4
- if: matrix.targetPlatform == 'StandaloneWindows64'
run: zip -r build/build-${{ matrix.targetPlatform }}.zip build/${{ matrix.targetPlatform }}
- if: matrix.targetPlatform == 'StandaloneWindows64'
uses: actions/upload-artifact@v4
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
path: build/build-${{ matrix.targetPlatform }}.zip
- if: matrix.targetPlatform == 'StandaloneOSX'
run: tar -czvf build/build-${{ matrix.targetPlatform }}.tar.gz build/${{ matrix.targetPlatform }}
- if: matrix.targetPlatform == 'StandaloneOSX'
uses: actions/upload-artifact@v4
with:
name: Build-${{ matrix.targetPlatform }}
path: build/build-${{ matrix.targetPlatform }}.tar.gz
58 changes: 58 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release

on:
workflow_run:
workflows: [Build]
types: [completed]
push:
tags: v[0-9]+.[0-9]+.[0-9]+

jobs:
release:
name: Create release
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}
fetch-depth: 0
lfs: false
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.workflow_run.head_branch }}
release_name: ${{ github.event.workflow_run.head_branch }}
body_path: RELEASE.md
draft: false
prerelease: false
- uses: actions/download-artifact@v4
with:
path: build
merge-multiple: true
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.run_id }}
- run: ls -la *
- run: ls -la build/*
- run: ls -la build/StandaloneOSX/*
- name: Upload Windows release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: micromissiles-${{ github.event.workflow_run.head_branch }}-windows_x86_64.zip
asset_path: build/build-StandaloneWindows64.zip
asset_content_type: application/zip
- name: Upload Darwin release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: micromissiles-${{ github.event.workflow_run.head_branch }}-darwin.tar.gz
asset_path: build/build-StandaloneOSX.tar.gz
asset_content_type: application/gzip
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,33 @@

![Sim Salvo Animation](docs/images/sim_salvo_animation.gif)

# Getting started **developing** micromissiles-unity
# Quick Start

We generate pre-built standalone binaries for Windows and Mac users from the `release` branch. These binaries are intended for non-development users who just want to run the application and modify a few configurations along the way.

You can find the latest release [here](https://github.com/PisterLab/micromissiles-unity/releases/latest).

## Windows

1. Download the zip file for Windows: `micromissiles-<version>-windows_x86_64.zip`.
2. Unzip the zip file. The zip file should contain a single directory called `micromissiles-<version>-windows_x86_64`.
3. Run `micromissiles-<version>-StandaloneWindows64.exe`.

## Mac

1. Download the zip file for Darwin: `micromissiles-<version>-darwin.zip`.
2. Unzip the zip file. The zip file should contain a single app file.
3. Change the permission of the app file recursively by running:
```bash
chmod -R +x micromissiles-<version>-StandaloneOSX.app
```
4. Open the app file.
5. If you get a warning that Apple cannot check the application for malicious software:
* Open `System Preferences`.
* Navigate to `Privacy & Security`.
* Click on `Open Anyway` to bypass Apple's developer check.

# Development

This guide will help you set up and run the project in development mode. You'll learn how to install Unity Hub, open the project, and navigate the main scene.

Expand All @@ -19,7 +45,7 @@ This guide will help you set up and run the project in development mode. You'll

## Prerequisites

- A computer with internet access ;)
- A computer with internet access.
- Administrative privileges to install software.
- [Git](https://git-scm.com/downloads) installed on your system (optional, for cloning the repository).

Expand Down Expand Up @@ -54,7 +80,7 @@ Alternatively, you can download the repository as a ZIP file and extract it to a
- Navigate to the **"Projects"** tab.
- Click on the **"ADD"** button.
- Browse to the folder where you cloned or extracted the project.
- Select the folder containing the `Assets` folder and click **"Select Folder"**.
- Select the folder containing the `Assets` folder and click on **"Select Folder"**.

3. **Install the Required Unity Version**:
- Unity Hub will detect if the project requires a Unity version that is not currently installed.
Expand All @@ -65,7 +91,6 @@ Alternatively, you can download the repository as a ZIP file and extract it to a
4. **Open the Project**:
- Once the required Unity version is installed, click on the project name in Unity Hub to open it.


### 4. Open the Main Scene

After the project opens in Unity:
Expand All @@ -90,4 +115,4 @@ After the project opens in Unity:
## Additional Resources

- [Keybinds and Controls](docs/Keybinds_and_Controls.md)
- [Simulation Configuration Guide](docs/Simulation_Config_Guide.md)
- [Simulation Configuration Guide](docs/Simulation_Config_Guide.md)
27 changes: 27 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# micromissiles-unity

## Build ${{ github.event.workflow_run.head_branch }}

## Instructions

Download and extract the archive corresponding to your platform (Windows or Mac) from the binaries listed below.

## Windows

1. Download the zip file for Windows: `micromissiles-${{ github.event.workflow_run.head_branch }}-windows_x86_64.zip`.
2. Unzip the zip file. The zip file should contain a single directory called `micromissiles-${{ github.event.workflow_run.head_branch }}-windows_x86_64`.
3. Run `micromissiles-<version>-StandaloneWindows64.exe`.

## Mac

1. Download the zip file for Darwin: `micromissiles-${{ github.event.workflow_run.head_branch }}-darwin.zip`.
2. Unzip the zip file. The zip file should contain a single app file.
3. Change the permission of the app file recursively by running:
```bash
chmod -R +x micromissiles-<version>-StandaloneOSX.app
```
4. Open the app file.
5. If you get a warning that Apple cannot check the application for malicious software:
* Open `System Preferences`.
* Navigate to `Privacy & Security`.
* Click on `Open Anyway` to bypass Apple's developer check.

0 comments on commit bb05531

Please sign in to comment.