Build and Publish #10
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
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: Docker Build | |
run: docker build --tag dumpsc-json:latest ./ | |
- name: Docker Run | |
run: | | |
docker run \ | |
--name dumpsc-json \ | |
-v $(pwd)/assets:/assets \ | |
-v $(pwd)/output:/output \ | |
dumpsc-json:latest | |
- name: Compress Files | |
run: zip raw_json.zip output/*.json | |
- 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: raw_json.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 }} |