diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5aeccfb39d..362fa762e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -76,8 +76,8 @@ jobs: with: version: ${{ needs.source.outputs.version }} - upload-aws: - name: Upload (AWS) + upload-cdn: + name: Upload (CDN) needs: - source - docs @@ -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: diff --git a/.github/workflows/upload-aws.yml b/.github/workflows/upload-cdn.yml similarity index 59% rename from .github/workflows/upload-aws.yml rename to .github/workflows/upload-cdn.yml index 72319ad5ab..735c8ef8b6 100644 --- a/.github/workflows/upload-aws.yml +++ b/.github/workflows/upload-cdn.yml @@ -1,4 +1,4 @@ -name: Upload (AWS) +name: Upload (CDN) on: workflow_call: @@ -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 @@ -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 - # 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 }} + publish: + needs: + - prepare - - name: Trigger 'New OpenTTD release' + 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 + + 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 '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 }}"}' diff --git a/.github/workflows/upload-gog.yml b/.github/workflows/upload-gog.yml index b4a591fdcc..269e4c5243 100644 --- a/.github/workflows/upload-gog.yml +++ b/.github/workflows/upload-gog.yml @@ -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: | diff --git a/.github/workflows/upload-steam.yml b/.github/workflows/upload-steam.yml index cd646dd81c..0939d125cb 100644 --- a/.github/workflows/upload-steam.yml +++ b/.github/workflows/upload-steam.yml @@ -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