Skip to content

Build Test Distribute #97

Build Test Distribute

Build Test Distribute #97

name: Build Test Distribute
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: '0 17 * * *' # Run every day at 17:00 UTC
#- cron: '0 6 * * *' # Run every day at 6 AM UTC
#UPLOAD_ARTIFACTS condition: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
jobs:
prepare-image:
uses: ./.github/workflows/prepare-images.yml
secrets: inherit
versioning-and-release-url:
uses: ./.github/workflows/versioning-release.yml
with:
version-namespace: ${{ contains(github.event.pull_request.labels.*.name, 'full-ci') && github.event_name != 'push' && 'pr-test' || '' }}
UPLOAD_ARTIFACTS: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
secrets:
BUILD_MACHINE_TOKEN: ${{ secrets.BUILD_MACHINE_TOKEN }}
windows-build-test:
needs: [ prepare-image, versioning-and-release-url ]
uses: ./.github/workflows/build-test-windows.yml
with:
full_config_build: ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
UPLOAD_ARTIFACTS: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
secrets: inherit
ubuntu20-build-test:
needs: [ prepare-image, versioning-and-release-url ]
uses: ./.github/workflows/build-test-ubuntu20.yml
with:
docker_image_tag: ${{needs.prepare-image.outputs.docker_image_tag}}
app_version: ${{needs.versioning-and-release-url.outputs.app_version}}
full_config_build: ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
UPLOAD_ARTIFACTS: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
secrets: inherit
ubuntu-arm64-build-test:
needs: [ prepare-image, versioning-and-release-url ]
uses: ./.github/workflows/build-test-ubuntu-arm64.yml
with:
docker_image_tag: ${{needs.prepare-image.outputs.docker_image_tag}}
app_version: ${{needs.versioning-and-release-url.outputs.app_version}}
full_config_build: ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
UPLOAD_ARTIFACTS: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
secrets: inherit
ubuntu22-build-test:
needs: [ prepare-image, versioning-and-release-url ]
uses: ./.github/workflows/build-test-ubuntu22.yml
with:
docker_image_tag: ${{needs.prepare-image.outputs.docker_image_tag}}
app_version: ${{needs.versioning-and-release-url.outputs.app_version}}
full_config_build: ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
UPLOAD_ARTIFACTS: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
secrets: inherit
fedora-build-test:
needs: [ prepare-image, versioning-and-release-url ]
uses: ./.github/workflows/build-test-fedora.yml
with:
docker_image_tag: ${{needs.prepare-image.outputs.docker_image_tag}}
app_version: ${{needs.versioning-and-release-url.outputs.app_version}}
full_config_build: ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
UPLOAD_ARTIFACTS: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
secrets: inherit
emscripten-build-test:
needs: [ prepare-image, versioning-and-release-url ]
uses: ./.github/workflows/build-test-emscripten.yml
with:
docker_image_tag: ${{needs.prepare-image.outputs.docker_image_tag}}
UPLOAD_ARTIFACTS: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
macos-build-test:
needs: [ versioning-and-release-url ]
uses: ./.github/workflows/build-test-macos.yml
with:
app_version: ${{needs.versioning-and-release-url.outputs.app_version}}
UPLOAD_ARTIFACTS: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
secrets: inherit
update-win-version:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
needs: [ windows-build-test ]
timeout-minutes: 15
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Windows Binaries Archive
uses: actions/download-artifact@v4
with:
pattern: WindowsArchive*
merge-multiple: true
- name: Extract Windows Binaries
run: |
tar -xvzf MREDist_Release.zip
tar -xvzf MREDist_Debug.zip
- name: Make Install Folder
run: py -3.10 scripts\make_install_folder.py ${{needs.versioning-and-release-url.outputs.app_version}}
- name: Distribute
run: py -3.10 scripts\zip_distribution.py MeshLibDist.zip
- name: Upload Windows Distribution
uses: actions/upload-artifact@v4
with:
name: DistributivesWin
path: MeshLibDist.zip
retention-days: 1
upload-distributions:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
timeout-minutes: 10
runs-on: ubuntu-latest
needs:
- update-win-version
- ubuntu20-build-test
- ubuntu22-build-test
- ubuntu-arm64-build-test
- fedora-build-test
- emscripten-build-test
- macos-build-test
- versioning-and-release-url
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download All Developer Distributives
uses: actions/download-artifact@v4
with:
pattern: Distributives*
merge-multiple: true
- name: Rename Distributives
run: |
mv MeshLibDist.zip MeshLibDist_${{needs.versioning-and-release-url.outputs.app_version}}.zip
mv meshlib-ubuntu20-dev.deb meshlib_${{needs.versioning-and-release-url.outputs.app_version}}_ubuntu20-dev.deb
mv meshlib-ubuntu22-dev.deb meshlib_${{needs.versioning-and-release-url.outputs.app_version}}_ubuntu22-dev.deb
mv meshlib-ubuntu20-arm64-dev.deb meshlib_${{needs.versioning-and-release-url.outputs.app_version}}_ubuntu20-arm64-dev.deb
mv meshlib-ubuntu22-arm64-dev.deb meshlib_${{needs.versioning-and-release-url.outputs.app_version}}_ubuntu22-arm64-dev.deb
mv meshlib-dev.rpm meshlib_${{needs.versioning-and-release-url.outputs.app_version}}-dev.rpm
mv meshlib_x64.pkg meshlib_${{needs.versioning-and-release-url.outputs.app_version}}_x64.pkg
mv meshlib_arm.pkg meshlib_${{needs.versioning-and-release-url.outputs.app_version}}_arm.pkg
- name: Upload Distributives
run: |
echo ${{ secrets.BUILD_MACHINE_TOKEN }} | gh auth login --with-token
gh release upload ${{needs.versioning-and-release-url.outputs.tag}} \
MeshLibDist_${{needs.versioning-and-release-url.outputs.app_version}}.zip \
meshlib_${{needs.versioning-and-release-url.outputs.app_version}}_ubuntu20-dev.deb \
meshlib_${{needs.versioning-and-release-url.outputs.app_version}}_ubuntu22-dev.deb \
meshlib_${{needs.versioning-and-release-url.outputs.app_version}}_ubuntu20-arm64-dev.deb \
meshlib_${{needs.versioning-and-release-url.outputs.app_version}}_ubuntu22-arm64-dev.deb \
meshlib_${{needs.versioning-and-release-url.outputs.app_version}}-dev.rpm \
meshlib_${{needs.versioning-and-release-url.outputs.app_version}}_x64.pkg \
meshlib_${{needs.versioning-and-release-url.outputs.app_version}}_arm.pkg
test-distribution:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'full-ci') }}
needs: [ versioning-and-release-url, upload-distributions ]
uses: ./.github/workflows/test-distribution.yml
with:
release_id: ${{needs.versioning-and-release-url.outputs.release_id}}
update-artifacts:
timeout-minutes: 15
runs-on: ubuntu-20.04
needs: [ upload-distributions ]
if: always()
steps:
# all Windows
- name: Delete Windows Debug Install Archive artifact
uses: geekyeggo/delete-artifact@v4
with:
name: WindowsArchive*
failOnError: false
# Distributives
- name: Delete Distribution
uses: geekyeggo/delete-artifact@v4
with:
name: Distributives*
failOnError: false
- name: Delete Wheelhouse
uses: geekyeggo/delete-artifact@v4
with:
name: Wheelhouse*
failOnError: false
# generate timing logs archive
- name: Download Timing Logs Archive
uses: actions/download-artifact@v4
with:
pattern: Timing_Logs*
merge-multiple: true
- name: Generate Timing Logs Archive
run: tar -cvzf time_log.tar.gz ./*.csv
- name: Upload Timing Logs Archive
uses: actions/upload-artifact@v4
with:
name: time_log
path: time_log.tar.gz
retention-days: 1
- name: Delete Timing Logs Source
uses: geekyeggo/delete-artifact@v4
with:
name: Timing_Logs*
failOnError: false