forked from Galaxy1036/Dumpsc
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
173 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Build and Publish | ||
|
||
env: | ||
FINGERPRINT: b8cb4e1c4ee7485bafc34123e4cb2b5b869b4f93 | ||
GAME_ASSET_URL: https://game-assets.clashofclans.com | ||
|
||
on: | ||
release: | ||
types: created | ||
workflow_dispatch: | ||
inputs: | ||
fingerprint: | ||
description: 'Fingerprint' | ||
required: true | ||
|
||
jobs: | ||
build: | ||
name: Build and Publish | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set ENV | ||
if: ${{ inputs.fingerprint }} | ||
run: echo "FINGERPRINT=$FINGERPRINT" >> "$GITHUB_ENV" | ||
env: | ||
FINGERPRINT: ${{ inputs.fingerprint }} | ||
|
||
- name: Download Game Assets | ||
run: | | ||
chmod +x ./scripts/downloader.sh | ||
echo "Downloading files with the fingerprint $FINGERPRINT" | ||
./scripts/downloader.sh $FINGERPRINT | ||
- name: Copy Files | ||
run: cp -r assets/sc/ In-Compressed/ | ||
|
||
- name: Docker Build | ||
run: docker build --tag dumpsc:latest ./ | ||
|
||
- name: Docker Run | ||
run: | | ||
docker run \ | ||
--name dumpsc \ | ||
-v $(pwd)/Out-Sprites:/Out-Sprites \ | ||
-v $(pwd)/In-Compressed:/In-Compressed \ | ||
dumpsc:latest | ||
- name: Compress Files | ||
run: zip assets.zip Out-Sprites/**/*.png | ||
|
||
- id: auth | ||
uses: google-github-actions/auth@v2 | ||
with: | ||
credentials_json: ${{ secrets.GCP_CREDENTIALS_JSON }} | ||
export_environment_variables: true | ||
|
||
- id: upload-to-gcp | ||
uses: google-github-actions/upload-cloud-storage@v2 | ||
with: | ||
path: assets.zip | ||
destination: ${{ secrets.GCP_BUCKET_NAME }}/assets.zip | ||
|
||
- name: Uploaded URL | ||
run: echo "$FILE" | ||
env: | ||
FILE: ${{ steps.upload-to-gcp.outputs.uploaded }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Build and Test | ||
|
||
on: | ||
push: | ||
branches: master | ||
|
||
env: | ||
FINGERPRINT: b8cb4e1c4ee7485bafc34123e4cb2b5b869b4f93 | ||
GAME_ASSET_URL: https://game-assets.clashofclans.com | ||
SC_FILE_NAME: ui_cc.sc | ||
SC_TEX_FILE_NAME: ui_cc_tex.sc | ||
|
||
jobs: | ||
build: | ||
name: Build and Test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Docker Build | ||
run: docker build --tag dumpsc:latest ./ | ||
|
||
- name: Download Test File | ||
run: | | ||
mkdir In-Compressed | ||
curl -o In-Compressed/$SC_FILE_NAME $GAME_ASSET_URL/$FINGERPRINT/sc/$SC_FILE_NAME | ||
curl -o In-Compressed/$SC_TEX_FILE_NAME $GAME_ASSET_URL/$FINGERPRINT/sc/$SC_TEX_FILE_NAME | ||
- name: Docker Run | ||
run: | | ||
docker run \ | ||
--name dumpsc \ | ||
-v $(pwd)/Out-Sprites:/Out-Sprites \ | ||
-v $(pwd)/In-Compressed:/In-Compressed \ | ||
dumpsc:latest | ||
- name: Showoff | ||
run: | | ||
echo $(ls -R Out-Sprites) | ||
echo "It worked. Damn!" | ||
- name: Compress Files | ||
run: zip assets.zip Out-Sprites/**/*.png | ||
|
||
- name: GCP Login | ||
uses: google-github-actions/auth@v2 | ||
with: | ||
credentials_json: ${{ secrets.GCP_CREDENTIALS_JSON }} | ||
export_environment_variables: true | ||
|
||
- name: Upload to GCS | ||
id: upload-to-gcs | ||
uses: google-github-actions/upload-cloud-storage@v2 | ||
with: | ||
path: assets.zip | ||
destination: ${{ secrets.GCP_BUCKET_NAME }}/assets.zip | ||
|
||
- name: Uploaded URL | ||
run: echo "$FILE" | ||
env: | ||
FILE: ${{ steps.upload-to-gcs.outputs.uploaded }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
In-Compressed/ | ||
Out-Sprites/ | ||
Dumpsc | ||
assets/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
shopt -s extglob # Enable extended globbing | ||
|
||
if [ "$#" -eq 1 ]; then | ||
fingerprint="$1" | ||
else | ||
fingerprint="b8cb4e1c4ee7485bafc34123e4cb2b5b869b4f93" | ||
fi | ||
|
||
base_url="https://game-assets.clashofclans.com" | ||
|
||
# Step 1: Download fingerprint.json | ||
curl -O $base_url/$fingerprint/fingerprint.json | ||
|
||
# Step 2: Extract file URLs and SHA from fingerprint.json | ||
file_info=$(grep -Eo '"file":"[^"]+"' fingerprint.json | awk -F'"' '{print $4, $8}') | ||
|
||
# Step 3: Download each file from the extracted URLs | ||
while read -r file | ||
do | ||
# Replace backslashes with forward slashes in the file path | ||
file=$(echo "$file" | sed 's/\\\//\//g') | ||
|
||
# Check if the file starts with "sc" or "csv", if not, skip it | ||
# if [[ $file == @(sc|csv|logic|localization)/* ]]; | ||
if [[ $file == @(sc)/* ]]; | ||
then | ||
# Create the directory if it doesn't exist | ||
mkdir -p "assets/$(dirname "$file")" | ||
|
||
echo "Downloading $file" | ||
curl -o "assets/$(dirname "$file")/$(basename "$file")" "$base_url/$fingerprint/$file" | ||
# else | ||
# echo "Skipping $file" | ||
fi | ||
done <<< "$file_info" | ||
|
||
echo "Download complete!" |