Skip to content

Commit 1b368c1

Browse files
authored
build: 🔧 Setup beta workfloww (#13)
* t * t * c * c * Update hlds.txt * Update Dockerfile * Update Dockerfile * Update hlds.txt * Update hlds.txt * Update publish.yml * Update publish.yml * Update publish.yml * Update validate.yml * Update pull-request-label.yml * Update pull-request-label.yml * fix: resolve publishing issues * Delete pull-request-label.yml * Update beta.yml * Update beta.yml * Update beta.yml
1 parent 6d49b7b commit 1b368c1

File tree

5 files changed

+100
-14
lines changed

5 files changed

+100
-14
lines changed

.github/workflows/beta.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Publish Beta Docker Images 🐋 📦
2+
on:
3+
push:
4+
branches:
5+
- beta
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
packages: write
11+
contents: write
12+
attestations: write
13+
id-token: write
14+
strategy:
15+
matrix:
16+
game: [cstrike, valve, czero, dmc, gearbox, ricochet, dod, tfc]
17+
steps:
18+
- name: Checkout 🛎️
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: "0"
22+
23+
- name: Set up Docker Buildx 🛠️
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Login to DockerHub 🐳
27+
uses: docker/login-action@v3
28+
with:
29+
username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
31+
32+
- name: Login to GitHub Container Registry 🐳
33+
uses: docker/login-action@v3
34+
with:
35+
registry: ghcr.io
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Replace fallback value in Dockerfile and entrypoint.sh
40+
run: |
41+
sed -i "s/\${GAME:-valve}/\${GAME:-${{ matrix.game }}}/g" Dockerfile
42+
sed -i "s/\${GAME:-valve}/\${GAME:-${{ matrix.game }}}/g" entrypoint.sh
43+
44+
- name: Build and Push Docker Image to DockerHub 🐳
45+
uses: docker/build-push-action@v5
46+
env:
47+
GAME: ${{ matrix.game }}
48+
with:
49+
context: .
50+
push: true
51+
tags: jives/hlds:${{ matrix.game }}-beta
52+
build-args: GAME=${{ matrix.game }}
53+
54+
- name: Set repo owner to lowercase
55+
id: repo_owner
56+
run: echo "::set-output name=repo_owner::$(echo ${{ github.repository_owner }} | awk '{print tolower($0)}')"
57+
58+
- name: Build and Push Docker Image to GitHub Container Registry 🐳
59+
uses: docker/build-push-action@v5
60+
env:
61+
GAME: ${{ matrix.game }}
62+
with:
63+
context: .
64+
push: true
65+
tags: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-beta
66+
build-args: GAME=${{ matrix.game }}

.github/workflows/publish.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,26 @@ on:
44
branches:
55
- main
66
jobs:
7+
version:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
version: ${{ steps.create_tag.outputs.new_tag }}
11+
steps:
12+
- name: Checkout 🛎️
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: "0"
16+
17+
- name: Bump Version and Create Tag 🏷️
18+
id: create_tag
19+
uses: anothrNick/[email protected]
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
WITH_V: true
23+
DEFAULT_BUMP: patch
24+
DRY_RUN: true
725
build:
26+
needs: version
827
runs-on: ubuntu-latest
928
permissions:
1029
packages: write
@@ -48,7 +67,9 @@ jobs:
4867
with:
4968
context: .
5069
push: true
51-
tags: jives/hlds:${{ matrix.game }}
70+
tags: |
71+
jives/hlds:${{ matrix.game }}
72+
jives/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }}
5273
build-args: GAME=${{ matrix.game }}
5374

5475
- name: Set repo owner to lowercase
@@ -62,7 +83,9 @@ jobs:
6283
with:
6384
context: .
6485
push: true
65-
tags: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}
86+
tags: |
87+
ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}
88+
ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }}
6689
build-args: GAME=${{ matrix.game }}
6790

6891
publish:
@@ -78,6 +101,7 @@ jobs:
78101

79102
- name: Bump Version and Create Tag 🏷️
80103
id: create_tag
104+
if: github.ref == 'refs/heads/main'
81105
uses: anothrNick/[email protected]
82106
env:
83107
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -86,6 +110,7 @@ jobs:
86110

87111
- name: Create Release 🚀
88112
id: create_release
113+
if: github.ref == 'refs/heads/main'
89114
uses: actions/create-release@v1
90115
env:
91116
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pull-request-label.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/validate.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches-ignore:
55
- main
6+
- beta
67
workflow_dispatch:
78
jobs:
89
build:

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ COPY ./hlds.txt /opt/steam
2525
# Replace $GAME with the requested mod to install in hlds.txt.
2626
RUN sed -i "s/\$GAME/${GAME}/g" /opt/steam/hlds.txt
2727

28+
RUN if [ "$GAME" = "gearbox" ]; then \
29+
for i in 10 50 70 90; do \
30+
wget -q https://raw.githubusercontent.com/dgibbs64/HLDS-appmanifest/main/OpposingForce/appmanifest_$i.acf -O appmanifest_$i.acf; \
31+
done; \
32+
fi
33+
2834
RUN curl -v -sL media.steampowered.com/client/installer/steamcmd_linux.tar.gz | tar xzvf - && \
2935
file /opt/steam/linux32/steamcmd && \
3036
./steamcmd.sh +runscript /opt/steam/hlds.txt

0 commit comments

Comments
 (0)