Skip to content

Commit dfbc338

Browse files
committed
Add update GA workflow with dockerhub job
1 parent 3fd1a2b commit dfbc338

File tree

2 files changed

+215
-0
lines changed

2 files changed

+215
-0
lines changed

.github/workflows/update.yml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Update
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- .github/workflows/update.yml
9+
- DOCKERHUB.md
10+
workflow_dispatch:
11+
12+
env:
13+
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
14+
SLACK_SIGNING_SECRET: ${{ secrets.SLACK_SIGNING_SECRET }}
15+
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
16+
17+
jobs:
18+
dockerhub:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out
22+
uses: actions/checkout@v4
23+
- name: Send Slack notification
24+
uses: codedsolar/slack-action@v1
25+
if: ${{ github.event_name != 'pull_request' }}
26+
id: slack
27+
with:
28+
fields: |
29+
{STATUS}
30+
{REF}
31+
Short description length: Checking...
32+
Description length: Checking...
33+
status: in-progress
34+
- name: Output additional GitHub context
35+
id: github
36+
run: |
37+
description=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
38+
"https://api.github.com/repos/${{ github.repository }}" | \
39+
jq -r '.description')
40+
echo "description=$description" >> $GITHUB_OUTPUT
41+
- name: Output lengths
42+
id: lengths
43+
run: |
44+
description=$(cat ./DOCKERHUB.md | wc -c)
45+
short_description=$(echo '${{ steps.github.outputs.description }}' | wc -c)
46+
47+
echo "description=$description" >> $GITHUB_OUTPUT
48+
echo "short-description=$short_description" >> $GITHUB_OUTPUT
49+
- name: Check results
50+
run: |
51+
description_length='${{ steps.lengths.outputs.description }}'
52+
short_description='${{ steps.github.outputs.description }}'
53+
short_description_length='${{ steps.lengths.outputs.short-description }}'
54+
55+
echo "Short description: $short_description"
56+
echo "Short description length: $short_description_length"
57+
echo "Description length: $description_length"
58+
59+
exit_code=1
60+
if [ "$description_length" -gt 0 ] && [ "$description_length" -lt 25000 ] && [ "$short_description_length" -gt 0 ]; then
61+
exit_code=0
62+
fi
63+
exit "$exit_code"
64+
- name: Update Docker Hub repository overview
65+
uses: peter-evans/dockerhub-description@v3
66+
if: ${{ !env.ACT }}
67+
with:
68+
username: ${{ secrets.DOCKERHUB_USERNAME }}
69+
password: ${{ secrets.DOCKERHUB_TOKEN }}
70+
repository: ${{ github.repository_owner }}/ktools
71+
short-description: ${{ steps.github.outputs.description }}
72+
readme-filepath: ./DOCKERHUB.md
73+
- name: Update Slack notification
74+
uses: codedsolar/slack-action@v1
75+
if: ${{ github.event_name != 'pull_request' && always() }}
76+
with:
77+
fields: |
78+
{STATUS}
79+
{REF}
80+
Short description length: ${{ steps.lengths.outputs.short-description || 'Skipped' }}
81+
Description length: ${{ steps.lengths.outputs.description || 'Skipped' }}
82+
status: ${{ job.status }}
83+
timestamp: ${{ steps.slack.outputs.slack-timestamp }}

DOCKERHUB.md

+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
## Supported tags and respective `Dockerfile` links
2+
3+
- [`4.5.1-imagemagick-7.1.1-30-alpine`, `4.5.1`, `alpine`, `latest`](https://github.com/dstmodders/docker-ktools/blob/7ef33349f1b1be037c8f1757171ad82404cca97c/latest/alpine/Dockerfile)
4+
- [`4.5.1-imagemagick-7.1.1-30-debian`, `debian`](https://github.com/dstmodders/docker-ktools/blob/7ef33349f1b1be037c8f1757171ad82404cca97c/latest/debian/Dockerfile)
5+
- [`4.5.0-imagemagick-7.1.1-30-alpine`, `4.5.0`, `alpine`](https://github.com/dstmodders/docker-ktools/blob/7ef33349f1b1be037c8f1757171ad82404cca97c/latest/alpine/Dockerfile)
6+
- [`4.5.0-imagemagick-7.1.1-30-debian`, `debian`](https://github.com/dstmodders/docker-ktools/blob/7ef33349f1b1be037c8f1757171ad82404cca97c/latest/debian/Dockerfile)
7+
- [`4.5.0-imagemagick-7.1.0-5-alpine`](https://github.com/dstmodders/docker-ktools/blob/ef2d40c3fc2e675ca492371e0e539f13449a1846/latest/alpine/Dockerfile)
8+
- [`4.5.0-imagemagick-7.1.0-5-debian`](https://github.com/dstmodders/docker-ktools/blob/ef2d40c3fc2e675ca492371e0e539f13449a1846/latest/debian/Dockerfile)
9+
- [`4.4.1-imagemagick-6.9.13-8-alpine`, `4.4.1`, `alpine`](https://github.com/dstmodders/docker-ktools/blob/7ef33349f1b1be037c8f1757171ad82404cca97c/latest/alpine/Dockerfile)
10+
- [`4.4.1-imagemagick-6.9.13-8-debian`, `debian`](https://github.com/dstmodders/docker-ktools/blob/7ef33349f1b1be037c8f1757171ad82404cca97c/latest/debian/Dockerfile)
11+
- [`official-4.4.0-imagemagick-6.9.13-8-alpine`, `official-4.4.0`, `official-alpine`, `official-latest`](https://github.com/dstmodders/docker-ktools/blob/7ef33349f1b1be037c8f1757171ad82404cca97c/official/alpine/Dockerfile)
12+
- [`official-4.4.0-imagemagick-6.9.13-8-debian`, `official-debian`](https://github.com/dstmodders/docker-ktools/blob/7ef33349f1b1be037c8f1757171ad82404cca97c/official/debian/Dockerfile)
13+
- [`official-4.3.1-imagemagick-6.9.13-8-alpine`, `official-4.3.1`, `official-alpine`](https://github.com/dstmodders/docker-ktools/blob/7ef33349f1b1be037c8f1757171ad82404cca97c/official/alpine/Dockerfile)
14+
- [`official-4.3.1-imagemagick-6.9.13-8-debian`, `official-debian`](https://github.com/dstmodders/docker-ktools/blob/7ef33349f1b1be037c8f1757171ad82404cca97c/official/debian/Dockerfile)
15+
- [`official-4.3.0-imagemagick-6.9.13-8-alpine`, `official-4.3.0`, `official-alpine`](https://github.com/dstmodders/docker-ktools/blob/7ef33349f1b1be037c8f1757171ad82404cca97c/official/alpine/Dockerfile)
16+
- [`official-4.3.0-imagemagick-6.9.13-8-debian`, `official-debian`](https://github.com/dstmodders/docker-ktools/blob/7ef33349f1b1be037c8f1757171ad82404cca97c/official/debian/Dockerfile)
17+
18+
## Overview
19+
20+
[Docker] images for modding tools of Klei Entertainment's game
21+
[Don't Starve].
22+
23+
- [Environment variables](#environment-variables)
24+
- [Usage](#usage)
25+
- [Build](#build)
26+
27+
## Environment variables
28+
29+
| Name | Value | Description |
30+
| --------------------- | ---------------------- | --------------------- |
31+
| `DS_KTOOLS_KRANE` | `/usr/local/bin/krane` | Path to [krane] |
32+
| `DS_KTOOLS_KTECH` | `/usr/local/bin/ktech` | Path to [ktech] |
33+
| `DS_KTOOLS_VERSION` | `4.5.1` | [ktools] version |
34+
| `IMAGEMAGICK_VERSION` | `7.1.1-30` | [ImageMagick] version |
35+
36+
## Usage
37+
38+
[Fork releases] (recommended):
39+
40+
```shell
41+
$ docker pull dstmodders/ktools:latest
42+
# or
43+
$ docker pull ghcr.io/dstmodders/ktools:latest
44+
```
45+
46+
Or you can pick one of the [official releases]:
47+
48+
```shell
49+
$ docker pull dstmodders/ktools:official
50+
# or
51+
$ docker pull ghcr.io/dstmodders/ktools:official
52+
```
53+
54+
See [tags] for a list of all available versions.
55+
56+
#### Shell/Bash (Linux & macOS)
57+
58+
```shell
59+
$ docker run --rm -v "$(pwd):/data/" dstmodders/ktools ktech --version
60+
```
61+
62+
#### CMD (Windows)
63+
64+
```cmd
65+
> docker run --rm -v "%CD%:/data/" dstmodders/ktools ktech --version
66+
```
67+
68+
#### PowerShell (Windows)
69+
70+
```powershell
71+
PS:\> docker run --rm -v "${PWD}:/data/" dstmodders/ktools ktech --version
72+
```
73+
74+
## Build
75+
76+
To build images locally:
77+
78+
```shell
79+
$ docker build ./latest/alpine/ --tag='dstmodders/ktools:alpine'
80+
$ docker build ./latest/debian/ --tag='dstmodders/ktools:debian'
81+
$ docker build ./official/alpine/ --tag='dstmodders/ktools:official-alpine'
82+
$ docker build ./official/debian/ --tag='dstmodders/ktools:official-debian'
83+
```
84+
85+
To build images locally using [buildx] to target multiple platforms, ensure that
86+
your builder is running. If you are using [QEMU] emulation, you may also need to
87+
enable [qemu-user-static].
88+
89+
In overall, to create your builder and enable [QEMU] emulation:
90+
91+
```shell
92+
$ docker buildx create --name mybuilder --use --bootstrap
93+
$ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
94+
```
95+
96+
Respectively, to build multi-platform images locally:
97+
98+
```shell
99+
$ docker buildx build ./latest/alpine/ --platform='linux/amd64,linux/386' --tag='dstmodders/ktools:alpine'
100+
$ docker buildx build ./latest/debian/ --platform='linux/amd64,linux/386' --tag='dstmodders/ktools:debian'
101+
$ docker buildx build ./official/alpine/ --platform='linux/amd64,linux/386' --tag='dstmodders/ktools:official-alpine'
102+
$ docker buildx build ./official/debian/ --platform='linux/amd64,linux/386' --tag='dstmodders/ktools:official-debian'
103+
```
104+
105+
## License
106+
107+
Released under the [MIT License](https://opensource.org/licenses/MIT).
108+
109+
[@nsimplex]: https://github.com/nsimplex
110+
[alpine size]: https://img.shields.io/docker/image-size/dstmodders/ktools/alpine?label=alpine%20size&logo=docker
111+
[build]: https://img.shields.io/github/actions/workflow/status/dstmodders/docker-ktools/build.yml?branch=main&label=build&logo=github
112+
[buildx]: https://github.com/docker/buildx
113+
[ci]: https://img.shields.io/github/actions/workflow/status/dstmodders/docker-ktools/ci.yml?branch=main&label=ci&logo=github
114+
[debian size]: https://img.shields.io/docker/image-size/dstmodders/ktools/debian?label=debian%20size&logo=docker
115+
[docker]: https://www.docker.com/
116+
[don't starve]: https://www.klei.com/games/dont-starve
117+
[dstmodders/ktools]: https://github.com/dstmodders/ktools
118+
[fork releases]: https://github.com/dstmodders/ktools/releases
119+
[gcc]: https://gcc.gnu.org/
120+
[imagemagick]: https://imagemagick.org/index.php
121+
[krane]: https://github.com/nsimplex/ktools#krane
122+
[ktech]: https://github.com/nsimplex/ktools#ktech
123+
[ktools]: https://github.com/nsimplex/ktools
124+
[latest state]: https://github.com/nsimplex/ktools/tree/a1d1362bdb2b9aa9146d7177fbf0e351eab414ba
125+
[nsimplex/ktools]: https://github.com/nsimplex/ktools
126+
[official releases]: https://github.com/nsimplex/ktools/releases
127+
[official]: https://github.com/nsimplex/ktools/releases
128+
[qemu-user-static]: https://github.com/multiarch/qemu-user-static
129+
[qemu]: https://www.qemu.org/
130+
[tags]: https://hub.docker.com/r/dstmodders/ktools/tags
131+
[v4.4.0]: https://github.com/dstmodders/ktools/releases/tag/4.4.0
132+
[v4.4.1]: https://github.com/dstmodders/ktools/releases/tag/v4.4.1

0 commit comments

Comments
 (0)