Changeset - r27671:9107d9c1e34e
[Not reviewed]
master
1 3 1
Patric Stout - 11 months ago 2023-07-01 12:30:57
truebrain@openttd.org
Change: [CI] upload releases to new CDN (#11093)
5 files changed with 142 insertions and 81 deletions:
0 comments (0 inline, 0 general)
.github/workflows/release.yml
Show inline comments
 
@@ -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:
.github/workflows/upload-aws.yml
Show inline comments
 
deleted file
.github/workflows/upload-cdn.yml
Show inline comments
 
new file 100644
 
name: Upload (CDN)
 

	
 
on:
 
  workflow_call:
 
    inputs:
 
      version:
 
        required: true
 
        type: string
 
      folder:
 
        required: true
 
        type: string
 
      trigger_type:
 
        required: true
 
        type: string
 

	
 
jobs:
 
  prepare:
 
    name: Prepare
 

	
 
    runs-on: ubuntu-latest
 

	
 
    steps:
 
    - name: Download all bundles
 
      uses: actions/download-artifact@v3
 

	
 
    - name: Calculate checksums
 
      run: |
 
        echo "::group::Move bundles to a single folder"
 
        mkdir bundles
 
        mv openttd-*/* bundles/
 
        echo "::endgroup::"
 

	
 
        cd bundles
 
        for i in $(ls openttd-*); do
 
          echo "::group::Calculating checksums for ${i}"
 
          openssl dgst -r -md5 -hex $i > $i.md5sum
 
          openssl dgst -r -sha1 -hex $i > $i.sha1sum
 
          openssl dgst -r -sha256 -hex $i > $i.sha256sum
 
          echo "::endgroup::"
 
        done
 

	
 
        # Some targets generate files that are meant for our-eyes-only.
 
        # They are stored in the "internal" folder, and contains bundles
 
        # for targets like Windows Store. No user has a benefit of knowing
 
        # they exist, hence: internal.
 
        if [ -e internal ]; then
 
          cd internal
 
          for i in $(ls openttd-*); do
 
            echo "::group::Calculating checksums for ${i}"
 
            openssl dgst -r -md5 -hex $i > $i.md5sum
 
            openssl dgst -r -sha1 -hex $i > $i.sha1sum
 
            openssl dgst -r -sha256 -hex $i > $i.sha256sum
 
            echo "::endgroup::"
 
          done
 
        fi
 

	
 
    - 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
 

	
 
    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: publish-docs
 
        client-payload: '{"version": "${{ inputs.version }}", "folder": "${{ inputs.folder }}"}'
.github/workflows/upload-gog.yml
Show inline comments
 
@@ -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: |
.github/workflows/upload-steam.yml
Show inline comments
 
@@ -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
0 comments (0 inline, 0 general)