Skip to content

Commit ea26747

Browse files
shymegaclaude
andcommitted
feat: Initial commit
Use Claude Code to generate a Docker-based workflow for creating Proton prefixes for DeckCheatz/wemod-launcher. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> Signed-off-by: Dom Rodriguez <[email protected]>
0 parents  commit ea26747

File tree

8 files changed

+1555
-0
lines changed

8 files changed

+1555
-0
lines changed
Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
name: Build Wine Prefixes with Docker
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
vendor:
7+
description: 'Proton vendor (only proton-ge supported)'
8+
required: true
9+
default: 'proton-ge'
10+
type: choice
11+
options:
12+
- proton-ge
13+
release_count:
14+
description: 'Number of releases to build'
15+
required: true
16+
default: '2'
17+
type: string
18+
19+
schedule:
20+
# Run weekly on Sundays at 06:00 UTC
21+
- cron: '0 6 * * 0'
22+
23+
push:
24+
branches: [ main ]
25+
paths:
26+
- 'Dockerfile'
27+
- 'docker-scripts/**'
28+
- '.github/workflows/build-prefixes-docker.yml'
29+
30+
env:
31+
REGISTRY: ghcr.io
32+
IMAGE_NAME: ${{ github.repository }}/wine-prefix-builder
33+
34+
jobs:
35+
fetch-releases:
36+
runs-on: ubuntu-latest
37+
outputs:
38+
matrix: ${{ steps.generate-matrix.outputs.matrix }}
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
43+
- name: Fetch Proton releases
44+
id: fetch-releases
45+
run: |
46+
chmod +x scripts/fetch-proton-releases.sh
47+
48+
VENDOR="${{ github.event.inputs.vendor || 'proton-ge' }}"
49+
COUNT="${{ github.event.inputs.release_count || '2' }}"
50+
51+
echo "Fetching releases with vendor: $VENDOR, count: $COUNT"
52+
53+
# Create output directory
54+
mkdir -p release-data
55+
56+
# Fetch releases
57+
./scripts/fetch-proton-releases.sh "$VENDOR" urls "$COUNT" > release-data/releases.txt
58+
59+
echo "Release data:"
60+
cat release-data/releases.txt
61+
62+
- name: Generate build matrix
63+
id: generate-matrix
64+
run: |
65+
# Convert release URLs to GitHub Actions matrix format
66+
matrix_items=()
67+
68+
while IFS='|' read -r vendor version url; do
69+
if [[ -n "$vendor" && -n "$version" && -n "$url" ]]; then
70+
matrix_items+=("{\"vendor\":\"$vendor\",\"version\":\"$version\",\"url\":\"$url\"}")
71+
fi
72+
done < release-data/releases.txt
73+
74+
# Join matrix items
75+
matrix_json="[$(IFS=','; echo "${matrix_items[*]}")]"
76+
echo "Generated matrix: $matrix_json"
77+
echo "matrix=$matrix_json" >> $GITHUB_OUTPUT
78+
79+
build-image:
80+
runs-on: ubuntu-latest
81+
permissions:
82+
contents: read
83+
packages: write
84+
outputs:
85+
image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
86+
digest: ${{ steps.build.outputs.digest }}
87+
steps:
88+
- name: Checkout repository
89+
uses: actions/checkout@v4
90+
91+
- name: Set up Docker Buildx
92+
uses: docker/setup-buildx-action@v3
93+
94+
- name: Log in to Container Registry
95+
uses: docker/login-action@v3
96+
with:
97+
registry: ${{ env.REGISTRY }}
98+
username: ${{ github.actor }}
99+
password: ${{ secrets.GITHUB_TOKEN }}
100+
101+
- name: Extract metadata
102+
id: meta
103+
uses: docker/metadata-action@v5
104+
with:
105+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
106+
tags: |
107+
type=sha
108+
type=raw,value=latest,enable={{is_default_branch}}
109+
110+
- name: Build and push Docker image
111+
id: build
112+
uses: docker/build-push-action@v5
113+
with:
114+
context: .
115+
push: true
116+
tags: ${{ steps.meta.outputs.tags }}
117+
labels: ${{ steps.meta.outputs.labels }}
118+
cache-from: type=gha
119+
cache-to: type=gha,mode=max
120+
121+
build-prefixes:
122+
runs-on: ubuntu-latest
123+
needs: [fetch-releases, build-image]
124+
if: needs.fetch-releases.outputs.matrix != '[]'
125+
strategy:
126+
fail-fast: false
127+
matrix:
128+
include: ${{ fromJson(needs.fetch-releases.outputs.matrix) }}
129+
130+
container:
131+
image: ${{ needs.build-image.outputs.image }}
132+
options: --privileged
133+
134+
steps:
135+
- name: Checkout repository
136+
uses: actions/checkout@v4
137+
138+
- name: Create output directory
139+
run: |
140+
mkdir -p /output
141+
chmod 777 /output
142+
143+
- name: Build Wine prefix
144+
run: |
145+
echo "Building Wine prefix for ${{ matrix.vendor }} ${{ matrix.version }}"
146+
echo "Source URL: ${{ matrix.url }}"
147+
148+
# Copy scripts to container
149+
cp -r docker-scripts/* /scripts/
150+
chmod +x /scripts/*.sh
151+
152+
# Run the prefix builder
153+
/scripts/build-prefix.sh "${{ matrix.url }}" /output
154+
env:
155+
DISPLAY: :99
156+
157+
- name: Upload artifacts
158+
uses: actions/upload-artifact@v4
159+
with:
160+
name: wine-prefix-${{ matrix.vendor }}-${{ matrix.version }}
161+
path: /output/
162+
retention-days: 30
163+
164+
create-release:
165+
runs-on: ubuntu-latest
166+
needs: [build-prefixes]
167+
if: startsWith(github.ref, 'refs/tags/')
168+
permissions:
169+
contents: write
170+
steps:
171+
- name: Checkout repository
172+
uses: actions/checkout@v4
173+
174+
- name: Download all artifacts
175+
uses: actions/download-artifact@v4
176+
with:
177+
path: ./artifacts
178+
179+
- name: Prepare release assets
180+
run: |
181+
mkdir -p release-assets
182+
183+
# Collect all archives and metadata
184+
find artifacts/ -name "*.tar.gz" -exec cp {} release-assets/ \;
185+
find artifacts/ -name "*.zip" -exec cp {} release-assets/ \;
186+
find artifacts/ -name "*.json" -exec cp {} release-assets/ \;
187+
188+
# Create combined metadata
189+
echo '{"prefixes":[' > release-assets/all-prefixes.json
190+
find artifacts/ -name "*.json" -exec cat {} \; | sed 's/^/,/' | sed '1s/^,//' >> release-assets/all-prefixes.json
191+
echo ']}' >> release-assets/all-prefixes.json
192+
193+
echo "Release assets prepared:"
194+
ls -la release-assets/
195+
196+
- name: Create GitHub Release
197+
uses: softprops/action-gh-release@v1
198+
with:
199+
files: release-assets/*
200+
body: |
201+
# Wine Prefixes Release ${{ github.ref_name }}
202+
203+
This release contains pre-built Wine prefixes for various Proton versions.
204+
205+
## Usage
206+
207+
1. Download the desired prefix archive (`.tar.gz` or `.zip`)
208+
2. Extract the archive
209+
3. Run `./scripts/install-prefix.sh` to install
210+
4. Use `./run-app.sh /path/to/app.exe` to run applications
211+
212+
## Available Prefixes
213+
214+
Check the `all-prefixes.json` file for complete metadata about all included prefixes.
215+
216+
## Build Information
217+
218+
- Built with: Docker Wine Prefix Builder
219+
- Build date: ${{ github.run_number }}
220+
- Commit: ${{ github.sha }}
221+
draft: false
222+
prerelease: false

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Build artifacts and cache
2+
/.cache
3+
/output
4+
/artifacts
5+
/archives
6+
7+
# Docker
8+
/result*
9+
10+
# Development
11+
.DS_Store
12+
*.log

.keep

Whitespace-only changes.

Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM ubuntu:24.04
2+
3+
# Set environment variables
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
ENV DISPLAY=:99
6+
ENV WINEPREFIX=/wine-prefix
7+
ENV WINEDLLOVERRIDES="mscoree,mshtml="
8+
9+
# Install essential tools (no Wine needed - Proton includes it)
10+
RUN apt-get update && apt-get install -y \
11+
wget \
12+
curl \
13+
unzip \
14+
zip \
15+
tar \
16+
xvfb \
17+
cabextract \
18+
p7zip-full \
19+
python3 \
20+
python3-pip \
21+
&& rm -rf /var/lib/apt/lists/*
22+
23+
# Install Winetricks (will use Proton's Wine)
24+
RUN wget -O /usr/local/bin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \
25+
&& chmod +x /usr/local/bin/winetricks
26+
27+
# Create directories
28+
RUN mkdir -p /wine-prefix /scripts /output
29+
30+
# Copy build scripts
31+
COPY docker-scripts/ /scripts/
32+
RUN chmod +x /scripts/*.sh
33+
34+
# Set working directory
35+
WORKDIR /workspace
36+
37+
# Default command
38+
CMD ["/scripts/build-prefix.sh"]

0 commit comments

Comments
 (0)