Skip to content

Commit

Permalink
Change: [CI] upload releases to new CDN (#11093)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueBrain committed Jul 1, 2023
1 parent 6169e7f commit d5a7219
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ jobs:
with:
version: ${{ needs.source.outputs.version }}

upload-aws:
name: Upload (AWS)
upload-cdn:
name: Upload (CDN)
needs:
- source
- docs
Expand All @@ -90,7 +90,7 @@ jobs:
# The always() makes sure the rest is always evaluated.
if: always() && needs.source.result == 'success' && needs.docs.result == 'success' && needs.linux.result == 'success' && needs.macos.result == 'success' && needs.windows.result == 'success' && (needs.windows-store.result == 'success' || needs.windows-store.result == 'skipped')

uses: ./.github/workflows/upload-aws.yml
uses: ./.github/workflows/upload-cdn.yml
secrets: inherit

with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Upload (AWS)
name: Upload (CDN)

on:
workflow_call:
Expand All @@ -14,10 +14,10 @@ on:
type: string

jobs:
upload:
name: Upload (AWS)
prepare:
name: Prepare

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- name: Download all bundles
Expand Down Expand Up @@ -54,23 +54,50 @@ jobs:
done
fi
- name: Upload bundles to AWS
run: |
aws s3 cp --recursive --only-show-errors bundles/ s3://${{ secrets.CDN_S3_BUCKET }}/${{ inputs.folder }}/${{ inputs.version }}/
- name: Store bundles
uses: actions/upload-artifact@v3
with:
name: cdn-bundles
path: bundles/*
retention-days: 5

publish:
needs:
- prepare

name: Publish
uses: OpenTTD/actions/.github/workflows/rw-cdn-upload.yml@v4
secrets:
CDN_SIGNING_KEY: ${{ secrets.CDN_SIGNING_KEY }}
DEPLOYMENT_APP_ID: ${{ secrets.DEPLOYMENT_APP_ID }}
DEPLOYMENT_APP_PRIVATE_KEY: ${{ secrets.DEPLOYMENT_APP_PRIVATE_KEY }}
with:
artifact-name: cdn-bundles
folder: ${{ inputs.folder }}
version: ${{ inputs.version }}

docs:
if: ${{ inputs.trigger_type == 'new-master' }}
needs:
- publish

# We do not invalidate the CloudFront distribution here. The trigger
# for "New OpenTTD release" first updated the manifest files and
# creates an index.html. We invalidate after that, so everything
# becomes visible at once.
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
name: Publish docs

runs-on: ubuntu-latest

steps:
- name: Generate access token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.DEPLOYMENT_APP_ID }}
private_key: ${{ secrets.DEPLOYMENT_APP_PRIVATE_KEY }}
repository: OpenTTD/workflows

- name: Trigger 'New OpenTTD release'
- name: Trigger 'Publish Docs'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.DEPLOYMENT_TOKEN }}
repository: OpenTTD/workflows
event-type: ${{ inputs.trigger_type }}
event-type: publish-docs
client-payload: '{"version": "${{ inputs.version }}", "folder": "${{ inputs.folder }}"}'
19 changes: 18 additions & 1 deletion .github/workflows/upload-gog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,25 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Download all bundles
- name: Download bundle (Windows x86)
uses: actions/download-artifact@v3
with:
name: openttd-windows-x86

- name: Download bundle (Windows x64)
uses: actions/download-artifact@v3
with:
name: openttd-windows-x64

- name: Download bundle (MacOS)
uses: actions/download-artifact@v3
with:
name: openttd-macos-universal

- name: Download bundle (Linux)
uses: actions/download-artifact@v3
with:
name: openttd-linux-generic

- name: Install GOG Galaxy Build Creator
run: |
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/upload-steam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,25 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Download all bundles
- name: Download bundle (Windows x86)
uses: actions/download-artifact@v3
with:
name: openttd-windows-x86

- name: Download bundle (Windows x64)
uses: actions/download-artifact@v3
with:
name: openttd-windows-x64

- name: Download bundle (MacOS)
uses: actions/download-artifact@v3
with:
name: openttd-macos-universal

- name: Download bundle (Linux)
uses: actions/download-artifact@v3
with:
name: openttd-linux-generic

- name: Setup steamcmd
uses: CyberAndrii/setup-steamcmd@v1
Expand Down

0 comments on commit d5a7219

Please sign in to comment.