Skip to content

Commit

Permalink
Update for 0.27.0; Use linuxdeploy container (#26)
Browse files Browse the repository at this point in the history
* Use linuxdeploy action 

* update, remove files no longer needed

* Rename script

* make-appimage.sh: replace tabs with spaces

* Update for 0.27.0, add docker-compose.yml

* update docs
  • Loading branch information
andy5995 authored Jan 31, 2025
1 parent e177b19 commit dc8f3fd
Show file tree
Hide file tree
Showing 12 changed files with 289 additions and 502 deletions.
2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

10 changes: 10 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# These variables can be overridden by exporting them from the
# command line when running `docker compose`
#
# Your numeric uid and gid
HOSTUID=
HOSTGID=

# When run from the root of your project directory, this will be
# the location in the container
WORKSPACE="/workspace"
61 changes: 31 additions & 30 deletions .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,62 @@ on:
workflow_dispatch:
push:
branches: [ "trunk" ]
paths:
- '.github/workflows/appimage.yml'
- 'AppRun'
- 'version'
- 'workflow.sh'
- '!**/docker.yml'
- '!Dockerfile*'
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README.md'
pull_request:
branches: [ "trunk" ]
paths:
- '.github/workflows/appimage.yml'
- 'AppRun'
- 'version'
- 'workflow.sh'
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README.md'

jobs:
# Label of the container job
build-appimage:
strategy:
fail-fast: false
matrix:
ubuntu_codename: ['focal', 'jammy']
container: andy5995/0ad-build-env:${{ matrix.ubuntu_codename }}
runs-on: ubuntu-22.04
os:
- ubuntu-24.04-arm
- ubuntu-24.04

runs-on: ubuntu-latest
env:
ARCH: x86_64
WORKSPACE: ${{ github.workspace }}
VERSION: 0.0.27-rc1-27645-alpha
UBUNTU_CODENAME: ${{ matrix.ubuntu_codename }}
VERSION: 0.27.0
MINISIGN_KEY: RWTWLbO12+ig3lUExIor3xd6DdZaYFEozn8Bu8nIzY3ImuRYQszIQyyy
steps:
- uses: actions/checkout@v4
- name: Run Workflow script

- name: Build AppImage
run: |
export HOSTUID=$(id -u) HOSTGID=$(id -g)
docker compose -f ./docker-compose.yml run --rm build
- 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' }}
uses: ncipollo/release-action@v1
with:
name: 0ad-${{ env.VERSION }} AppImage
allowUpdates: True
prerelease: ${{ contains(env.VERSION, 'svn') || contains(env.VERSION, 'rc') }}
artifacts: "${{ env.WORKSPACE }}/0ad*.AppImage*"
prerelease: ${{ contains(env.VERSION, 'rc') }}
artifacts: ./out/0ad*.AppImage*
token: ${{ secrets.GITHUB_TOKEN }}
omitNameDuringUpdate: True
omitBodyDuringUpdate: True
tag: v${{ env.VERSION }}
replacesArtifacts: true
replacesArtifacts: false
- name: Upload Artifacts
if: ${{ github.ref != 'refs/heads/trunk' }}
uses: actions/upload-artifact@v4
with:
name: AppImage
path: ${{ env.WORKSPACE }}/0ad*.AppImage*



name: AppImage-${{ matrix.os }}
path: ./out/0ad*.AppImage*
41 changes: 0 additions & 41 deletions .github/workflows/docker.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
/tools/
/linuxdeploy-plugin-gtk.sh
/*.AppImage*
/0ad-svn
/0ad-*
/minisign*linux.tar.gz*
/out
/premake*tar.gz
9 changes: 7 additions & 2 deletions AppRun
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
set -e

HERE="$(readlink -f "$(dirname "$0")")"
BINARY_NAME=$(basename "$ARGV0")

if [ "$BINARY_NAME" = "pyrogenesis" -o "$BINARY_NAME" = "0ad" ] ; then
BINARY_NAME=${BINARY_NAME:-"pyrogenesis"}

echo "To invoke the Actor editor:"
echo "BINARY_NAME=ActorEditor $0"
echo ""

if [ "$BINARY_NAME" = "pyrogenesis" ] || [ "$BINARY_NAME" = "0ad" ]; then
exec "$HERE/usr/bin/pyrogenesis" "$@"
elif [ "$BINARY_NAME" = "ActorEditor" ]; then
exec "$HERE/usr/bin/ActorEditor" "$@"
Expand Down
69 changes: 0 additions & 69 deletions Dockerfile-focal

This file was deleted.

70 changes: 0 additions & 70 deletions Dockerfile-jammy

This file was deleted.

58 changes: 5 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,62 +8,14 @@ Click on the [releases
link](https://github.com/0ad-matters/0ad-appimage/releases) to view
available appimages.

To access the `ActorEditor`, you'll need to create a [symbolic
link](https://devdojo.com/devdojo/what-is-a-symlink):
To invoke the `ActorEditor`:

cd /path/to/<Appimage-File>
ln -s <Appimage-File> ActorEditor

You can optionally create symbolic links for `0ad` and `pyrogenesis`
if desired:

ln -s <Appimage-File> 0ad
ln -s <Appimage-File> pyrogenesis
BINARY_NAME=ActorEditor <path/to/AppImage>

## 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

Version strings for stable releases are typically in the format:

0.0.26-alpha
0.0.25b-alpha
0.0.27-rc1-xxxxx-alpha (for release candidates)

To build on a different version of Ubuntu, precede the script with the
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).

If choosing the svn version, the svn repository will be checked out, unless
you aleady have it in the repo root.

## 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

repo root, to build the latest stable version:

export HOSTUID=$(id -u) HOSTGID=$(id -g) VERSION=0.27.0
docker compose -f ./docker-compose.yml run --rm build
Loading

0 comments on commit dc8f3fd

Please sign in to comment.