forked from Galaxy1036/Dumpsc
-
Notifications
You must be signed in to change notification settings - Fork 7
71 lines (58 loc) · 1.89 KB
/
build-and-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build and Publish
env:
FINGERPRINT: c4e8c2976dcf42530d68dcb1fdfb61d071085abf
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 -r assets.zip Out-Sprites
- 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 }}