Skip to content

Commit b5671f4

Browse files
authored
The sixth revision (#55)
1 parent b739826 commit b5671f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2044
-751
lines changed

.dockerignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Version control
2+
.git
3+
.gitignore
4+
5+
# Binaries and build artifacts
6+
bin/
7+
*.exe
8+
*.out
9+
*.test
10+
11+
# IDE/editor junk
12+
*.swp
13+
*.swo
14+
*.bak
15+
*.tmp
16+
*.DS_Store
17+
.vscode/
18+
.idea/
19+
20+
# Dependency directories
21+
vendor/
22+
23+
# Go test cache
24+
*.coverprofile
25+
*.cov
26+
coverage.out
27+
28+
# Logs
29+
*.log
30+
31+
# OS junk
32+
Thumbs.db
33+
34+
# Other unneeded files and directories
35+
*.csv
36+
*.json
37+
*.zip
38+
pyproject.toml
39+
requirements.txt
40+
Dockerfile
41+
.venv/
42+
games/
43+
tmp/
44+
temp/

.github/workflows/release.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
call_tests:
14-
uses: ./.github/workflows/tests.yml
1513

1614
build-windows:
1715
runs-on: windows-latest
1816
steps:
1917
- name: Checkout Repository
2018
uses: actions/checkout@v4
19+
with:
20+
lfs: true
2121

2222
- name: Setup MSYS2 Environment
2323
uses: msys2/setup-msys2@v2
@@ -55,6 +55,8 @@ jobs:
5555
steps:
5656
- name: Checkout Repository
5757
uses: actions/checkout@v4
58+
with:
59+
lfs: true
5860

5961
- name: Set up Go
6062
uses: actions/setup-go@v5
@@ -85,6 +87,8 @@ jobs:
8587
steps:
8688
- name: Checkout Repository
8789
uses: actions/checkout@v4
90+
with:
91+
lfs: true
8892

8993
- name: Set up Go
9094
uses: actions/setup-go@v5
@@ -109,6 +113,42 @@ jobs:
109113
name: gogg-macos-arm64
110114
path: bin/gogg
111115

116+
build-and-push-docker:
117+
runs-on: ubuntu-latest
118+
needs: [ build-linux ]
119+
permissions:
120+
contents: read
121+
packages: write
122+
123+
steps:
124+
- name: Checkout Repository
125+
uses: actions/checkout@v4
126+
127+
- name: Log in to the GitHub Container Registry
128+
uses: docker/login-action@v3
129+
with:
130+
registry: ghcr.io
131+
username: ${{ github.repository_owner }}
132+
password: ${{ secrets.GITHUB_TOKEN }}
133+
134+
- name: Extract Metadata (Tags and Labels) for Docker
135+
id: meta
136+
uses: docker/metadata-action@v5
137+
with:
138+
images: ghcr.io/${{ github.repository }}
139+
tags: |
140+
type=raw,value=latest
141+
type=ref,event=branch
142+
type=ref,event=tag
143+
144+
- name: Build and Push Docker Image
145+
uses: docker/build-push-action@v5
146+
with:
147+
context: .
148+
push: true
149+
tags: ${{ steps.meta.outputs.tags }}
150+
labels: ${{ steps.meta.outputs.labels }}
151+
112152
release:
113153
runs-on: ubuntu-latest
114154
needs: [ build-windows, build-linux, build-macos ]

.github/workflows/tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Run Tests
22

33
on:
44
workflow_dispatch:
5-
workflow_call:
65
pull_request:
76
branches:
87
- "main"

Dockerfile

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# ---- Builder Stage ----
2+
FROM golang:1.24-bookworm as builder
3+
4+
# Install build dependencies
5+
RUN apt-get update && \
6+
apt-get install -y --no-install-recommends \
7+
build-essential \
8+
pkg-config \
9+
libgl1-mesa-dev \
10+
libx11-dev \
11+
libxcursor-dev \
12+
libxrandr-dev \
13+
libxinerama-dev \
14+
libxi-dev \
15+
libxxf86vm-dev \
16+
libasound2-dev \
17+
ca-certificates \
18+
&& rm -rf /var/lib/apt/lists/*
19+
20+
WORKDIR /app
21+
22+
# Go module download
23+
COPY go.mod go.sum ./
24+
RUN go mod download
25+
26+
# Copy source
27+
COPY . .
28+
29+
# Build Gogg
30+
RUN go build -o bin/gogg .
31+
32+
# ---- Final Stage ----
33+
FROM debian:bookworm-slim
34+
35+
RUN apt-get update && \
36+
apt-get install -y --no-install-recommends \
37+
libgl1 \
38+
libx11-6 \
39+
libxcursor1 \
40+
libxrandr2 \
41+
libxinerama1 \
42+
libxi6 \
43+
libasound2 \
44+
libxxf86vm1 \
45+
xvfb \
46+
ca-certificates \
47+
htop nano duf ncdu \
48+
&& rm -rf /var/lib/apt/lists/* \
49+
&& apt-get autoremove -y \
50+
&& apt-get clean
51+
52+
# Set up directories
53+
COPY --from=builder /app/bin/gogg /usr/local/bin/gogg
54+
COPY scripts/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
55+
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
56+
57+
# Create a non-root user and group
58+
RUN addgroup --system gogg && adduser --system --ingroup gogg gogg
59+
RUN mkdir -p /config /downloads && chown -R gogg:gogg /config /downloads
60+
61+
# Set user and volume
62+
USER gogg
63+
VOLUME /config
64+
VOLUME /downloads
65+
ENV GOGG_HOME=/config
66+
67+
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ BINARY_NAME := $(or $(GOGG_BINARY), $(notdir $(REPO)))
44
BINARY := bin/$(BINARY_NAME)
55
COVER_PROFILE := coverage.txt
66
GO_FILES := $(shell find . -type f -name '*.go')
7-
EXTRA_TMP_FILES := $(shell find . -type f -name 'gogg_catalogue_*.csv' -o -name '*_output.txt')
7+
EXTRA_TMP_FILES := $(shell find . -type f -name 'gogg_*.csv' -o -name 'gogg_*.json' -o -name '*_output.txt')
88
GO ?= go
99
MAIN ?= ./main.go
1010
ECHO := @echo

README.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
<a href="https://github.com/habedi/gogg/actions/workflows/tests.yml">
1010
<img src="https://img.shields.io/github/actions/workflow/status/habedi/gogg/tests.yml?label=tests&style=flat&labelColor=555555&logo=github" alt="Tests">
1111
</a>
12-
<a href="https://github.com/habedi/gogg/actions/workflows/lints.yml">
13-
<img src="https://img.shields.io/github/actions/workflow/status/habedi/gogg/lints.yml?label=linters&style=flat&labelColor=555555&logo=github" alt="Linters">
14-
</a>
1512
<a href="https://github.com/habedi/gogg/actions/workflows/release.yml">
1613
<img src="https://img.shields.io/github/actions/workflow/status/habedi/gogg/release.yml?label=linux%20build&style=flat&labelColor=555555&logo=linux" alt="Linux Build">
1714
</a>
@@ -26,14 +23,17 @@
2623
<img src="https://img.shields.io/badge/docs-latest-3776ab?style=flat&labelColor=555555&logo=readthedocs" alt="Docs">
2724
</a>
2825
<a href="https://github.com/habedi/gogg">
29-
<img src="https://img.shields.io/badge/license-MIT-007ec6?style=flat&labelColor=555555&logo=open-source-initiative" alt="License">
26+
<img src="https://img.shields.io/badge/license-MIT-3776ab?style=flat&labelColor=555555&logo=open-source-initiative" alt="License">
3027
</a>
3128
<a href="https://codecov.io/gh/habedi/gogg">
3229
<img src="https://img.shields.io/codecov/c/github/habedi/gogg?style=flat&labelColor=555555&logo=codecov" alt="Code Coverage">
3330
</a>
3431
<a href="https://www.codefactor.io/repository/github/habedi/gogg">
3532
<img src="https://img.shields.io/codefactor/grade/github/habedi/gogg?style=flat&labelColor=555555&logo=codefactor" alt="CodeFactor">
3633
</a>
34+
<a href="https://github.com/habedi/gogg/pkgs/container/gogg">
35+
<img src="https://img.shields.io/github/v/release/habedi/gogg?label=image&logo=docker&logoColor=white&style=flat&color=007ec6" alt="Docker Image">
36+
</a>
3737
<a href="https://github.com/habedi/gogg/releases/latest">
3838
<img src="https://img.shields.io/github/release/habedi/gogg.svg?style=flat&labelColor=555555&logo=github" alt="Release">
3939
</a>
@@ -80,10 +80,12 @@ See the [documentation](docs/README.md) for how to install and use Gogg.
8080
Run `gogg -h` to see the available commands and options.
8181

8282
> [!NOTE]
83-
> Since version `0.4.1`, Gogg has a GUI besides its command line interface (CLI).
84-
> The GUI is still in the early stages of development and does not support all the features of the CLI and may have
85-
> bugs.
86-
> To start the GUI, run `gogg gui`.
83+
> * Since version `0.4.1`, Gogg has a GUI besides its command line interface (CLI).
84+
> The GUI is still in the early stages of development and does not support all the features of the CLI and may have
85+
> bugs.
86+
> To start the GUI, run `gogg gui`.
87+
> * Since version `0.4.2`, there are Docker images available for Gogg.
88+
> See the [documentation](docs/README.md#containerization) for more information.
8789
8890
#### Examples
8991

@@ -102,8 +104,8 @@ gogg login
102104
```
103105

104106
> [!IMPORTANT]
105-
> You need to have [Google Chrome](https://www.google.com/chrome/) or [Chromium](https://www.chromium.org/) installed on
106-
> your machine for the first-time authentication.
107+
> You might need to have [Google Chrome](https://www.google.com/chrome/), [Chromium](https://www.chromium.org/), or
108+
> [Microsoft Edge](https://www.microsoft.com/edge) browsers installed on your machine for the first-time authentication.
107109
> So, make sure you have one of them installed and available in your system's PATH.
108110
109111
##### Syncing the Game Catalogue
@@ -147,6 +149,24 @@ DEBUG_GOGG=false gogg file size 1207658924 --platform=windows --lang=en --dlcs=t
147149

148150
[![asciicast](https://asciinema.org/a/kXMGRUUV149R37IEmZKtTH7nI.svg)](https://asciinema.org/a/kXMGRUUV149R37IEmZKtTH7nI)
149151

152+
### GUI Screenshots
153+
154+
<div align="center">
155+
<img alt="Game Library" src="docs/screenshots/v0.4.2/5.png" width="100%">
156+
</div>
157+
158+
<details>
159+
<summary>Show more screenshots</summary>
160+
161+
<div align="center">
162+
<img alt="File Operations" src="docs/screenshots/v0.4.2/2.png" width="100%">
163+
<img alt="Download Games" src="docs/screenshots/v0.4.2/8.png" width="100%">
164+
<img alt="About" src="docs/screenshots/v0.4.2/14.png" width="100%">
165+
<img alt="Download Progress" src="docs/screenshots/v0.4.2/9.png" width="100%">
166+
</div>
167+
168+
</details>
169+
150170
---
151171

152172
### Contributing

0 commit comments

Comments
 (0)