Skip to content

Commit

Permalink
fix github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
csuvajit committed Jan 10, 2024
1 parent 304d5c4 commit c47d34e
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 130 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
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: 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 }}
130 changes: 0 additions & 130 deletions .github/workflows/main.yml

This file was deleted.

0 comments on commit c47d34e

Please sign in to comment.