Skip to content

Commit

Permalink
Build macOS app and extend the README.md regarding macOS release (#181)
Browse files Browse the repository at this point in the history
* Build macOS app and extend the README.md regarding macOS release
* chmod u+x for macOS build
* use ZIP instead of tar.gz for Windows build
* extract local setup into INSTALL.md
  • Loading branch information
Ecostack authored Mar 18, 2024
1 parent f000f15 commit 481891e
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 32 deletions.
18 changes: 18 additions & 0 deletions .github/tiny-world.app/Contents/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>Tiny World</string>
<key>CFBundleIdentifier</key>
<string>com.github.mlange42.tiny-world</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleIconFile</key>
<string>tiny-world.icns</string>
<key>CFBundleExecutable</key>
<string>tiny-world</string>
</dict>
</plist>
Binary file not shown.
33 changes: 24 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ jobs:
run: GOOS=windows GOARCH=amd64 CGO_ENABLED=1 go build .
- name: Compress binaries
run: |
tar -czf tiny-world.tar.gz tiny-world.exe
zip -r tiny-world.zip tiny-world.exe
shell: bash
- name: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: tiny-world.tar.gz
asset_name: tiny-world-${{ env.RELEASE_VERSION }}-windows-amd64.tar.gz
file: tiny-world.zip
asset_name: tiny-world-${{ env.RELEASE_VERSION }}-windows-amd64.zip
tag: ${{ github.ref }}

build-macos-arm64:
Expand All @@ -78,16 +78,24 @@ jobs:
go-version: '1.21.x'
- name: Build
run: GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build .
- name: Build APP Bundle
run: |
mkdir -p tiny-world.app
cp -r .github/tiny-world.app/Contents tiny-world.app/Contents
mkdir -p tiny-world.app/Contents/MacOS
chmod u+x tiny-world
mv tiny-world tiny-world.app/Contents/MacOS/tiny-world
shell: bash
- name: Compress binaries
run: |
tar -czf tiny-world.tar.gz tiny-world
zip -r tiny-world.zip tiny-world.app
shell: bash
- name: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: tiny-world.tar.gz
asset_name: tiny-world-${{ env.RELEASE_VERSION }}-macos-arm64.tar.gz
file: tiny-world.zip
asset_name: tiny-world-${{ env.RELEASE_VERSION }}-macos-arm64.zip
tag: ${{ github.ref }}

build-macos-amd64:
Expand All @@ -104,14 +112,21 @@ jobs:
go-version: '1.21.x'
- name: Build
run: GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build .
- name: Build APP Bundle
run: |
mkdir -p tiny-world.app
cp -r .github/tiny-world.app/Contents tiny-world.app/Contents
mkdir -p tiny-world.app/Contents/MacOS
chmod u+x tiny-world
mv tiny-world tiny-world.app/Contents/MacOS/tiny-world
- name: Compress binaries
run: |
tar -czf tiny-world.tar.gz tiny-world
zip -r tiny-world.zip tiny-world.app
shell: bash
- name: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: tiny-world.tar.gz
asset_name: tiny-world-${{ env.RELEASE_VERSION }}-macos-amd64.tar.gz
file: tiny-world.zip
asset_name: tiny-world-${{ env.RELEASE_VERSION }}-macos-amd64.zip
tag: ${{ github.ref }}
34 changes: 25 additions & 9 deletions .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ jobs:
run: GOOS=windows GOARCH=amd64 CGO_ENABLED=1 go build .
- name: Compress binaries
run: |
tar -czf tiny-world.tar.gz tiny-world.exe
zip -r tiny-world.zip tiny-world.exe
shell: bash
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: tiny-world-windows-amd64.tar.gz
path: tiny-world.tar.gz
name: tiny-world-windows-amd64.zip
path: tiny-world.zip

build-macos-arm64:
name: MacOS arm64 build
Expand All @@ -78,15 +78,23 @@ jobs:
go-version: '1.21.x'
- name: Build
run: GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build .
- name: Build APP Bundle
run: |
mkdir -p tiny-world.app
cp -r .github/tiny-world.app/Contents tiny-world.app/Contents
mkdir -p tiny-world.app/Contents/MacOS
chmod u+x tiny-world
mv tiny-world tiny-world.app/Contents/MacOS/tiny-world
shell: bash
- name: Compress binaries
run: |
tar -czf tiny-world.tar.gz tiny-world
zip -r tiny-world.zip tiny-world.app
shell: bash
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: tiny-world-macos-arm64.tar.gz
path: tiny-world.tar.gz
name: tiny-world-macos-arm64.zip
path: tiny-world.zip

build-macos-amd64:
name: MacOS amd64 build
Expand All @@ -102,12 +110,20 @@ jobs:
go-version: '1.21.x'
- name: Build
run: GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build .
- name: Build APP Bundle
run: |
mkdir -p tiny-world.app
cp -r .github/tiny-world.app/Contents tiny-world.app/Contents
mkdir -p tiny-world.app/Contents/MacOS
chmod u+x tiny-world
mv tiny-world tiny-world.app/Contents/MacOS/tiny-world
shell: bash
- name: Compress binaries
run: |
tar -czf tiny-world.tar.gz tiny-world
zip -r tiny-world.zip tiny-world.app
shell: bash
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: tiny-world-macos-amd64.tar.gz
path: tiny-world.tar.gz
name: tiny-world-macos-amd64.zip
path: tiny-world.zip
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
/save/
/maps/
/user/

# macOS binary
./tiny-world

.idea
26 changes: 26 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Installation Guide

### Precompiled binaries

You can download precompiled binaries for Linux, Windows and macOS from the [Releases](https://github.com/mlange-42/tiny-world/releases).

#### macOS version
For the macOS version, please right-click the app and select "Open" to bypass the security warning, as the binary is not signed.

In case you get the message `“tiny-world.app” is damaged and can’t be opened. You should move it to the Bin.`, please use the following command from the terminal:
```shell
xattr -c tiny-world.app
```
This will remove the quarantine attribute from the app. You can then open it as usual.

### Build from source

Clone the repository and build or run the game with [Go](https://go.dev):

```shell
git clone https://github.com/mlange-42/tiny-world.git
cd tiny-world
go run .
```

For building on Unix systems, `libgl1-mesa-dev` and `xorg-dev` are required.
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,9 @@ Made with [Ebitengine](https://github.com/hajimehoshi/ebiten) and the [Arche](ht
You can play Tiny World [on itch.io](https://mlange-42.itch.io/tiny-world),
or the development version [here](https://mlange-42.github.io/tiny-world/).

### Precompiled binaries
### Run locally

You can download precompiled binaries for Linux and Windows from the [Releases](https://github.com/mlange-42/tiny-world/releases).

### Build from source

Clone the repository and build or run the game with [Go](https://go.dev):

```shell
git clone https://github.com/mlange-42/tiny-world.git
cd tiny-world
go run .
```

For building on Unix systems, `libgl1-mesa-dev` and `xorg-dev` are required.
Please check the [installation guide here](INSTALL.md).

## Playing

Expand Down

0 comments on commit 481891e

Please sign in to comment.