Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Docker

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Build Docker image
run: |
docker build \
. \
--file Dockerfile \
--tag amulet-editor:latest \
--build-arg AMULET_VERSION=CUSTOM:git+https://github.com/Amulet-Team/Amulet-Map-Editor.git@${{ github.event.release.tag_name }}

- name: Save Docker image to tar archive
run: |
docker save amulet-editor:latest -o amulet-editor.tar

- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.event.release.tag_name }} \
amulet-editor.tar#Amulet-v${{ github.event.release.tag_name }}-docker.tar
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.9-bullseye
RUN apt-get update && apt install libgtk-3-dev dbus-x11 wget libnotify4 -y
RUN pip install --upgrade pip
RUN wget https://extras.wxpython.org/wxPython4/extras/linux/gtk3/debian-11/wxPython-4.2.0-cp39-cp39-linux_x86_64.whl && pip install wxPython-4.2.0-cp39-cp39-linux_x86_64.whl
ARG AMULET_VERSION=RELEASE # defaults to the latest version if no arg is given in build command.
RUN if [ "$(echo "$AMULET_VERSION" | cut -c1-7)" = "CUSTOM:" ]; then \
pip install "$(echo "$AMULET_VERSION" | cut -c8-)"; \
elif [ "$AMULET_VERSION" = "RELEASE" ]; then \
pip install --upgrade --upgrade-strategy eager amulet-map-editor; \
elif [ "$AMULET_VERSION" = "BETA" ]; then \
pip install --upgrade --upgrade-strategy eager amulet-map-editor>=0b0; \
elif [ "$AMULET_VERSION" = "ALPHA" ]; then \
pip install --upgrade --upgrade-strategy eager amulet-map-editor>=0a0; \
else \
pip install --upgrade --upgrade-strategy eager amulet-map-editor==$AMULET_VERSION; \
fi
RUN apt-get install libSDL2-2.0 -y

ENTRYPOINT [ "/usr/local/bin/python", "-m", "amulet_map_editor" ]
Loading