Files
@ r27841:362bf679e5ea
Branch filter:
Location: cpp/openttd-patchpack/source/.github/workflows/upload-cdn.yml
r27841:362bf679e5ea
3.7 KiB
text/x-yaml
Add: [CI] Create and store breakpad symbols for releases (#11247)
Additionally, also store PDB and exe files on the Symbol Server
for easier debugging with MSVC.
Additionally, also store PDB and exe files on the Symbol Server
for easier debugging with MSVC.
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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | 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: Merge symbols
run: |
mkdir symbols
cp -R symbols-*/* symbols/
# Compress all files as gzip, to reduce cost of storage on the CDN.
for i in $(find symbols -mindepth 2 -type f); do
gzip ${i}
done
# Leave a mark in each folder what version actually created the symbol file.
for i in $(find symbols -mindepth 2 -type d); do
touch ${i}/.${{ inputs.version }}.txt
done
- name: Store bundles
uses: actions/upload-artifact@v3
with:
name: cdn-bundles
path: bundles/*
retention-days: 5
- name: Store breakpad symbols
uses: actions/upload-artifact@v3
with:
name: cdn-symbols
path: symbols/*
retention-days: 5
publish-bundles:
needs:
- prepare
name: Publish bundles
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 }}
publish-symbols:
needs:
- prepare
name: Publish symbols
uses: OpenTTD/actions/.github/workflows/rw-symbols-upload.yml@v4
secrets:
SYMBOLS_SIGNING_KEY: ${{ secrets.SYMBOLS_SIGNING_KEY }}
with:
artifact-name: cdn-symbols
repository: OpenTTD
docs:
if: ${{ inputs.trigger_type == 'new-master' }}
needs:
- publish-bundles
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: ${{ steps.generate_token.outputs.token }}
repository: OpenTTD/workflows
event-type: publish-docs
client-payload: '{"version": "${{ inputs.version }}", "folder": "${{ inputs.folder }}"}'
|