Skip to content

Commit

Permalink
Build and Deploy Workflows (#2598)
Browse files Browse the repository at this point in the history
  • Loading branch information
niamu authored Nov 22, 2024
1 parent 9720a71 commit e346e69
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 12 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build

on:
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get install -y curl desktop-file-utils file libfuse2t64 lua5.4 make python3-pip python3-venv xvfb zip zsync

- name: Build
run: xvfb-run make clean validate test
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy

on:
push:
branches:
- release

jobs:
deploy:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get install -y curl desktop-file-utils file libfuse2t64 lua5.4 make python3-pip python3-venv xvfb zip zsync

- name: Deploy
run: xvfb-run make binaries

- name: Tar build artifacts
run: tar -cvf build/builds.tar build/hawkthorne-macos.zip build/hawkthorne-win32.zip build/hawkthorne-win64.zip build/hawkthorne-linux.AppImage build/hawkthorne.love

- uses: actions/upload-artifact@v4
with:
name: builds.zip
path: build/builds.tar
retention-days: 7
17 changes: 5 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
.PHONY: clean contributors validate run deploy maps lint love love.js
.PHONY: clean contributors validate run maps lint love love.js

UNAME := $(shell uname)
TILEMAPS := $(patsubst %.tmx,%.lua,$(wildcard src/maps/*.tmx))
LOVE_DOWNLOAD_URL = https://github.com/love2d/love/releases/download
LOVE_VERSION = 11.5
MACOS_APP=build/Journey\ to\ the\ Center\ of\ Hawkthorne.app
CI_TARGET=clean test validate maps binaries

ifeq ($(UNAME), Darwin)
TMXTAR = tmx2lua.osx.zip
Expand Down Expand Up @@ -91,19 +90,13 @@ bin/love.AppImage:
mkdir -p bin
$(WGET) $(LOVE_DOWNLOAD_URL)/$(LOVE_VERSION)/love-$(LOVE_VERSION)-x86_64.AppImage
mv love-$(LOVE_VERSION)-x86_64.AppImage bin/love.AppImage
chmod +x bin/love.AppImage
chmod a+x bin/love.AppImage

bin/appimagetool.AppImage:
mkdir -p bin
$(WGET) https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage
mv appimagetool-x86_64.AppImage bin/appimagetool.AppImage
chmod +x bin/appimagetool.AppImage

######################################################
# THE REST OF THESE TARGETS ARE FOR RELEASE AUTOMATION
######################################################

deploy: $(CI_TARGET)
chmod a+x bin/appimagetool.AppImage

build/win32/hawkthorne.exe: build/hawkthorne.love bin/win32/love.exe
mkdir -p build/win32
Expand Down Expand Up @@ -139,11 +132,11 @@ build/hawkthorne-linux.AppImage: build/hawkthorne.love bin/love.AppImage bin/app
bin/love.AppImage --appimage-extract
mv squashfs-root build/linux/
cat build/linux/squashfs-root/bin/love build/hawkthorne.love > build/linux/squashfs-root/bin/hawkthorne
chmod +x build/linux/squashfs-root/bin/hawkthorne
chmod a+x build/linux/squashfs-root/bin/hawkthorne
cp templates/linux/* build/linux/squashfs-root/
rm build/linux/squashfs-root/bin/love build/linux/squashfs-root/love.svg
./bin/appimagetool.AppImage build/linux/squashfs-root build/hawkthorne-linux.AppImage
chmod +x build/hawkthorne-linux.AppImage
chmod a+x build/hawkthorne-linux.AppImage

binaries: $(BINARIES)

Expand Down

0 comments on commit e346e69

Please sign in to comment.