Skip to content

Build and Publish

Build and Publish #17

name: Build and Publish
env:
FINGERPRINT: b8cb4e1c4ee7485bafc34123e4cb2b5b869b4f93
GAME_ASSET_URL: https://game-assets.clashofclans.com
GCP_BUCKET_NAME: game-assets-clashofclans.appspot.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
predefinedAcl: publicRead
destination: ${{ env.GCP_BUCKET_NAME }}
- name: Uploaded URL
run: echo "https://storage.googleapis.com/$GCP_BUCKET_NAME/$UPLOADED_FILE"
env:
UPLOADED_FILE: ${{ steps.upload-to-gcp.outputs.uploaded }}