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
3 changes: 0 additions & 3 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ description: Build a Dockerfile
inputs:
label:
description: "Optional build suffix, e.g. 'dev'"
type: string
required: false
repos:
description: "Newline-separated list of <registry>/<repository> used to build refs"
type: string
required: false
upstream-ref:
description: "Optional upstream ref override (e.g. 0.34.1); if omitted, the latest upstream release tag is used"
type: string
required: false

outputs:
Expand Down
5 changes: 0 additions & 5 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@ description: Publish a Docker image to one or more registries

inputs:
dockerhub-username:
type: string
required: false
dockerhub-password:
type: string
required: false
github-token:
type: string
required: true
forgejo-token:
type: string
required: true
refs:
type: string
required: true

runs:
Expand Down
9 changes: 4 additions & 5 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ runs:
echo "Testing crawl-tag file marker..."
output="$(docker run --rm --entrypoint cat "${IMAGE_REF}" /app/crawl-tag)"
if [[ "${output}" != "${CRAWL_TAG}" ]]; then
echo "❌ CRAWL_TAG mismatch: expected '${CRAWL_TAG}', got '${output}'"
echo "❌ crawl-tag: expected '${CRAWL_TAG}', got '${output}'"
exit 1
fi
echo "✅ CRAWL_TAG test passed"
echo "✅ crawl-tag: ${output}"

- name: Test crawl binary version
shell: bash -euo pipefail {0}
Expand All @@ -35,8 +35,7 @@ runs:
echo "Testing crawl binary version..."
output="$(docker run --rm --entrypoint ./crawl "${IMAGE_REF}" -version)"
if ! grep -qF "${CRAWL_TAG}" <<< "${output}"; then
echo "❌ Unexpected crawl version:"
echo "${output}"
echo "❌ 'crawl -version': expected '${CRAWL_TAG}', got '${output}'"
exit 1
fi
echo "✅ Crawl binary version test passed"
echo "✅ 'crawl -version': ${output}"
3 changes: 2 additions & 1 deletion .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Build and publish dev
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manually triggered dev build of {0}', inputs.upstream-ref || 'latest upstream release') || 'Automated dev build of latest upstream release' }}

on:
push:
Expand Down Expand Up @@ -26,8 +27,8 @@ jobs:
label: 'dev'
repos: |
ghcr.io/treyturner/dcss
docker.io/treyturner/dcss
forgejo.treyturner.info/treyturner/dcss
docker.io/treyturner/dcss
upstream-ref: ${{ inputs.upstream-ref }}

- name: Test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-and-test-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Build and test PR
run-name: 'Build and test #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}'

on:
pull_request:
Expand Down
56 changes: 24 additions & 32 deletions .github/workflows/promote-tag.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: Promote dev version tag to release version tag
name: Promote dev to release
run-name: Promote ${{ inputs.release-version }}-dev to ${{ inputs.release-version }}${{ inputs.promote-latest && ' and latest' || '' }}

on:
workflow_dispatch:
inputs:
release-version:
description: "Targeted release version tag (e.g. '0.34.1')"
description: "Targeted release tag (e.g. '0.34.1')"
type: string
required: true
promote-latest:
description: "Also promote to 'latest' tag (only enable if promoting the newest DCSS release)"
description: "Also promote to 'latest' (only enable if promoting the newest DCSS release)"
type: boolean
required: false
default: false
Expand Down Expand Up @@ -84,37 +85,28 @@ jobs:
TARGET_TAGS: ${{ steps.prepare.outputs.tags }}
run: |
owner_lower=$(printf '%s' "$GH_OWNER" | tr '[:upper:]' '[:lower:]')
# hub_source="${DOCKERHUB_USERNAME}/${PROJECT_NAME}:${SOURCE_TAG}"
ghcr_source="ghcr.io/${owner_lower}/${PROJECT_NAME}:${SOURCE_TAG}"
forgejo_source="forgejo.treyturner.info/${owner_lower}/${PROJECT_NAME}:${SOURCE_TAG}"

mkdir -p tags
printf '%s\n' "$TARGET_TAGS" > tags/list
declare -A repos=(
[ghcr.io]="${owner_lower}/${PROJECT_NAME}"
[forgejo.treyturner.info]="${owner_lower}/${PROJECT_NAME}"
[docker.io]="${DOCKERHUB_USERNAME}/${PROJECT_NAME}"
)

# echo "Validating source manifest on DockerHub: ${hub_source}"
# docker buildx imagetools inspect "${hub_source}" > /dev/null
for registry in "${!repos[@]}"; do
source="${registry}/${repos[$registry]}:${SOURCE_TAG}"
echo "Validating source manifest on ${registry}: ${source}"
docker buildx imagetools inspect "${source}" > /dev/null
done

echo "Validating source manifest on GHCR: ${ghcr_source}"
docker buildx imagetools inspect "${ghcr_source}" > /dev/null

echo "Validating source manifest on Forgejo: ${forgejo_source}"
docker buildx imagetools inspect "${forgejo_source}" > /dev/null

while IFS= read -r tag; do
mapfile -t tags <<< "$TARGET_TAGS"
for tag in "${tags[@]}"; do
[ -n "$tag" ] || continue

# echo "Promoting DockerHub tag: ${hub_source} -> ${tag}"
# docker buildx imagetools create \
# --tag "${DOCKERHUB_USERNAME}/${PROJECT_NAME}:${tag}" \
# "${hub_source}"

echo "Promoting GHCR tag: ${ghcr_source} -> ${tag}"
docker buildx imagetools create \
--tag "ghcr.io/${owner_lower}/${PROJECT_NAME}:${tag}" \
"${ghcr_source}"

echo "Promoting Forgejo tag: ${forgejo_source} -> ${tag}"
docker buildx imagetools create \
--tag "forgejo.treyturner.info/${owner_lower}/${PROJECT_NAME}:${tag}" \
"${forgejo_source}"
done < tags/list
for registry in "${!repos[@]}"; do
source="${registry}/${repos[$registry]}:${SOURCE_TAG}"
echo "Promoting ${registry} tag: ${source} -> ${tag}"
docker buildx imagetools create \
--tag "${registry}/${repos[$registry]}:${tag}" \
"${source}"
done
done
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Packages the open source turn-based CRPG [Dungeon Crawl Stone Soup](https://crawl.develz.org/) as a standalone server with webtiles support, allowing you to play in a browser from anywhere.

Images are published to Docker Hub, GitHub Container Registry, and Forgejo:
Images are published to GitHub Container Registry, Forgejo, and Docker Hub:

- `ghcr.io/treyturner/dcss`
- `forgejo.treyturner.info/treyturner/dcss`
Expand Down Expand Up @@ -168,10 +168,16 @@ docker run -d \

## Building from Source

To build the image locally:
To build an image of the latest upstream release:

```sh
docker build --build-arg CRAWL_TAG=0.34.1 -t dcss .
docker build -t dcss .
```

or specify a version via the `CRAWL_TAG` build arg, though the build will surely break at some prior version:

```sh
docker build --build-arg CRAWL_TAG=0.34.0 -t dcss .
```

| Build Argument | Default | Description |
Expand Down