Skip to content

Commit

Permalink
update, remove files no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
andy5995 committed Sep 28, 2024
1 parent 0ad08b4 commit 81e0585
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 250 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,35 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: ['amd64']
platform:
- linux/amd64
# - linux/arm64
codename:
- focal

runs-on: ubuntu-latest
env:
VERSION: 0.0.26-alpha
UBUNTU_CODENAME: ${{ matrix.ubuntu_codename }}
MINISIGN_KEY: RWTWLbO12+ig3lUExIor3xd6DdZaYFEozn8Bu8nIzY3ImuRYQszIQyyy
steps:
- uses: actions/checkout@v4
- name: Run Workflow script
- name: Build AppImage
run: |
docker run -t \
--rm \
--platform=${{ matrix.platform }} \
-e HOSTUID=$(id -u) \
-e VERSION \
-v $GITHUB_WORKSPACE:/workspace \
-w /workspace \
andy5995/linuxdeploy:${{ matrix.codename }} workflow.sh
- name: Create sha256sum
run: |
chmod 1777 "$WORKSPACE"
su 0adbuilder --command "GITHUB_ACTIONS=${GITHUB_ACTIONS} $WORKSPACE/workflow.sh"
IMAGE_FILENAME=$(basename `find out/*AppImage`)
echo "IMAGE_FILENAME=$IMAGE_FILENAME" >> $GITHUB_ENV
cd out
sha256sum "$IMAGE_FILENAME" > "$IMAGE_FILENAME.sha256sum"
- name: Release AppImage
if: ${{ github.ref == 'refs/heads/trunk' }}
Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/docker.yml

This file was deleted.

59 changes: 0 additions & 59 deletions Dockerfile-focal

This file was deleted.

70 changes: 0 additions & 70 deletions Dockerfile-jammy

This file was deleted.

35 changes: 4 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ if desired:
## Build locally

You can build the appimage locally if you have docker installed. While in the
repo root, to build the latest stable version, run:

./make-appimage.sh

or to build an svn snapshot:

VERSION=0.0.27-svn-unstable ./make-appimage.sh
repo root, to build the latest stable version, see the docker run arguments in
.github/workflows/appimage.yml (note you'll have to change variables that
normally get created earlier in the yml file).

Version strings for stable releases are typically in the format:

Expand All @@ -42,27 +38,4 @@ codename, e.g.

UBUNTU_CODENAME=jammy ./make_appimage.sh

(valid values are bionic, focal, or jammy)

To speed up the process, prior to running the above script, copy the source
and data archives (e.g., 0ad-0.0.26-alpha-unix-{build,data}.tar.xz) to the
repo root (otherwise they'll be downloaded during the script execution).

SOURCE_ROOT=$(pwd)/0ad-0.0.26-alpha ./workflow.sh

## HOWTO change versions after a 0 A.D. release

When running from the GitHub CI, change the VERSION string near the top of
appimage.yml.

If running the `make-appimage.sh` script locally, change the default VERSION
string near the top of `make-appimage.sh`.

In either case, you may also need to change the minisign key near the top of
`workflow.sh`.

To customize and publish the docker image (see the Dockerfile in this repo) to
your own Docker Hub account, you'll need to add a couple secrets to your
repository. See https://docs.github.com/en/actions/publishing-packages/publishing-docker-images


(valid values are focal, or jammy)
30 changes: 0 additions & 30 deletions make-appimage.sh

This file was deleted.

36 changes: 22 additions & 14 deletions workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ if [[ "$WORKSPACE" != /* ]]; then
fi
test -d "$WORKSPACE"

SOURCE_ROOT=${SOURCE_ROOT:-$ACTION_SOURCE_ROOT}
SOURCE_ROOT=${SOURCE_ROOT:-$WORKSPACE}
SOURCE_ROOT="$WORKSPACE/0ad-$VERSION"
if [[ "$SOURCE_ROOT" != /* ]]; then
echo "The source root path must be absolute"
exit 1
fi

if [ ! -r "$SOURCE_ROOT/source/main.cpp" ]; then
echo "set the source root!"
exit 1
fi

APPDIR=${APPDIR:-"/tmp/$USER-AppDir"}
if [ -d "$APPDIR" ]; then
rm -rf "$APPDIR"
Expand All @@ -32,7 +26,7 @@ fi
env
export -p

URI=https://releases.wildfiregames.com/rc
URI="https://releases.wildfiregames.com"

cd $WORKSPACE
if [ ! -e "AppRun" ]; then
Expand All @@ -47,7 +41,6 @@ sudo DEBIAN_FRONTEND=noninteractive -i sh -c "apt update && apt -y upgrade && \
apt install -y \
cargo \
libboost-dev \
g++-8 \
libboost-filesystem-dev \
libboost-system-dev \
libcurl4-gnutls-dev \
Expand All @@ -63,11 +56,11 @@ sudo DEBIAN_FRONTEND=noninteractive -i sh -c "apt update && apt -y upgrade && \
libsdl2-dev \
libsodium-dev \
libvorbis-dev \
libvulkan-dev \
libwxgtk3.0-gtk3-dev \
libxml2-dev \
m4 \
python3 \
python3-setuptools \
rustc \
zlib1g-dev"

Expand All @@ -82,7 +75,12 @@ if [ ! -f "$source" ]; then
done
fi
sha1sum -c $source_sum
tar -kxJf $WORKSPACE/$source
# tar --skip-old-files -xJf $source

if [ ! -r "$SOURCE_ROOT/source/main.cpp" ]; then
echo "Check the source root!"
exit 1
fi

# Spidermonkey build fails with 7, 8, 9, and 10 on Ubuntu focal?
#export CC=gcc-7
Expand All @@ -106,7 +104,7 @@ if [ ! -f "$data" ]; then
done
fi
sha1sum -c $data_sum
tar kxJf $data
tar --skip-old-files -xJf $data

# name: prepare AppDir

Expand Down Expand Up @@ -170,10 +168,20 @@ if [ -n "$ACTION_WORKSPACE" ]; then
rm -rf "$SOURCE_ROOT/binaries/data"
fi

# Set up output directory
OUT_DIR="$WORKSPACE/out"
if [ ! -d "$OUT_DIR" ]; then
mkdir "$OUT_DIR"
fi
cd "$OUT_DIR"

# Set LinuxDeploy output version
LINUXDEPLOY_OUTPUT_VERSION="$VERSION"

# Create the image
if [ -z "ACTION_WORKSPACE" ]; then
export DEPLOY_GTK_VERSION=3 # Variable used by gtk plugin
linuxdeploy \
# Variable used by gtk plugin
DEPLOY_GTK_VERSION=3 linuxdeploy \
-d $SOURCE_DIR/build/resources/0ad.desktop \
--icon-file=$SOURCE_DIR/build/resources/0ad.png \
--icon-filename=0ad \
Expand Down

0 comments on commit 81e0585

Please sign in to comment.