Build main ๐ #317
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Release | |
run-name: Build ${{ github.ref_name }} ๐ | |
on: | |
push: | |
branches: | |
- main | |
- release/* | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
CallPR: | |
name: โ Run PR Workflow | |
uses: ./.github/workflows/build-pr.yml | |
with: | |
is_called_workflow: true | |
do_instrumentation: ${{ github.ref_name == 'main' }} | |
secrets: inherit | |
DeployDocumentation: | |
name: โ๏ธ Deploy documentation | |
runs-on: [ self-hosted, Linux, Docker ] | |
if: github.ref_name == 'main' | |
permissions: write-all | |
needs: | |
- CallPR | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 # load all commits | |
- name: Initial repo config | |
run: tools/initial-repo-config.sh | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: Documentation-assets | |
- name: Deploy documentation to github pages | |
run: tools/publish-docs-on-github.sh | |
DeployInstaller: | |
name: โ๏ธ Deploy Installer | |
runs-on: [ self-hosted, Linux, Docker ] | |
permissions: write-all | |
needs: | |
- CallPR | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 # load all commits | |
- name: Initial repo config | |
run: tools/initial-repo-config.sh | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: BuildInstaller-user-assets | |
- name: Deploy release assets to github | |
run: tools/upload-github-release-asset.sh "${{ github.token }}" | |
GenerateReport: | |
name: ๐ Generate Reports | |
runs-on: [ self-hosted, Linux, Docker ] | |
if: github.ref_name == 'main' | |
needs: | |
- CallPR | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Initial repo config | |
run: tools/initial-repo-config.sh | |
- name: Download all artifacts | |
id: download | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: ๐ฅ Download report cache from FTP | |
id: cache-download | |
run: | | |
tools/ftp-upload/download-files.sh \ | |
-s "${{ vars.GHA_MIES_FTP_ARTEFACT_STORAGE_DNS }}" \ | |
-u "${{ secrets.GHA_MIES_FTP_ARTEFACT_STORAGE_USER }}" \ | |
-p "${{ secrets.GHA_MIES_FTP_ARTEFACT_STORAGE_PWD }}" \ | |
-d "history" \ | |
-t "cache/coverage-history" | |
- name: ๐ Generate Reports | |
id: gen | |
run: | | |
tools/report-generator/build.sh \ | |
-s "$(pwd)" \ | |
-d "${{ steps.download.outputs.download-path }}" \ | |
-h "${{ steps.cache-download.outputs.data }}" \ | |
-o report \ | |
-l "${{ secrets.GHA_MIES_REPORTGENERATOR_LICENSE }}" | |
- name: ๐ค Upload latest report to FTP | |
run: | | |
tools/ftp-upload/upload-files.sh \ | |
-s "${{ vars.GHA_MIES_FTP_ARTEFACT_STORAGE_DNS }}" \ | |
-u "${{ secrets.GHA_MIES_FTP_ARTEFACT_STORAGE_USER }}" \ | |
-p "${{ secrets.GHA_MIES_FTP_ARTEFACT_STORAGE_PWD }}" \ | |
-d "${{ steps.gen.outputs.report }}" \ | |
-t "report/coverage" | |
- name: ๐ค Upload report cache to FTP | |
run: | | |
tools/ftp-upload/upload-files.sh \ | |
-s "${{ vars.GHA_MIES_FTP_ARTEFACT_STORAGE_DNS }}" \ | |
-u "${{ secrets.GHA_MIES_FTP_ARTEFACT_STORAGE_USER }}" \ | |
-p "${{ secrets.GHA_MIES_FTP_ARTEFACT_STORAGE_PWD }}" \ | |
-d "${{ steps.gen.outputs.history }}" \ | |
-t "cache/coverage-history" | |
- name: upload artifacts | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: report-artifacts | |
path: | | |
${{ steps.gen.outputs.report }} | |
if-no-files-found: warn | |
FTPUpload: | |
name: ๐ฆ FTP Upload Artifacts | |
runs-on: [ self-hosted, Linux, Docker ] | |
if: ${{ !cancelled() }} | |
needs: | |
# All jobs that create new artifacts | |
- CallPR | |
- GenerateReport | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Initial repo config | |
run: tools/initial-repo-config.sh | |
- name: Download all artifacts | |
id: download | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Flatten artifact structure | |
run: | | |
find "${{ steps.download.outputs.download-path }}" -mindepth 1 -maxdepth 1 -type d |\ | |
xargs -I {} tools/ftp-upload/flatten-files.sh "{}" | |
- name: Compress some artifacts | |
run: tools/ftp-upload/compress-files.sh "${{ steps.download.outputs.download-path }}" | |
- name: Upload artifacts using FTP | |
run: | | |
tools/ftp-upload/upload-files.sh \ | |
-s "${{ vars.GHA_MIES_FTP_ARTEFACT_STORAGE_DNS }}" \ | |
-u "${{ secrets.GHA_MIES_FTP_ARTEFACT_STORAGE_USER }}" \ | |
-p "${{ secrets.GHA_MIES_FTP_ARTEFACT_STORAGE_PWD }}" \ | |
-d "${{ steps.download.outputs.download-path }}" \ | |
-t "deploy/$(echo "${{ github.ref_name }}" | sed "s@/@_@g")/${{ github.sha }}/${{ github.run_attempt }}" |