Skip to content

Commit a6c710a

Browse files
Fix docker workflow (#1186)
* Support alpha and beta releases * Add local install option
1 parent e11abab commit a6c710a

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.github/workflows/docker-image.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
name: Docker Image CI
1+
name: Build Docker
22

33
on:
4-
workflow_run:
5-
workflows: [Build]
6-
types:
7-
- completed
4+
release:
5+
types: [published]
86

97
jobs:
108
build:
@@ -20,7 +18,7 @@ jobs:
2018
. \
2119
--file Dockerfile \
2220
--tag amulet-editor:latest \
23-
--build-arg AMULET_VERSION=${{ github.event.release.tag_name }}
21+
--build-arg AMULET_VERSION=LOCAL
2422
2523
- name: Save Docker image to tar archive
2624
run: |

Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,18 @@ FROM python:3.9-bullseye
22
RUN apt-get update && apt install libgtk-3-dev dbus-x11 wget libnotify4 -y
33
RUN pip install --upgrade pip
44
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
5-
ARG AMULET_VERSION # defaults to the latest version if no arg is given in build command.
6-
RUN pip install amulet-map-editor==$AMULET_VERSION
5+
ARG AMULET_VERSION=RELEASE # defaults to the latest version if no arg is given in build command.
6+
RUN if [ "$AMULET_VERSION" = "LOCAL" ]; then \
7+
pip install .; \
8+
elif [ "$AMULET_VERSION" = "RELEASE" ]; then \
9+
pip install --upgrade --upgrade-strategy eager amulet-map-editor; \
10+
elif [ "$AMULET_VERSION" = "BETA" ]; then \
11+
pip install --upgrade --upgrade-strategy eager amulet-map-editor>=0b0; \
12+
elif [ "$AMULET_VERSION" = "ALPHA" ]; then \
13+
pip install --upgrade --upgrade-strategy eager amulet-map-editor>=0a0; \
14+
else \
15+
pip install --upgrade --upgrade-strategy eager amulet-map-editor==$AMULET_VERSION; \
16+
fi
717
RUN apt-get install libSDL2-2.0 -y
818

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

0 commit comments

Comments
 (0)