Nightly build #52
This file contains hidden or 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
| #----------------------------------------------------------------------------- | |
| # | |
| # TSDuck - The MPEG Transport Stream Toolkit | |
| # Copyright (c) 2005-2025, Thierry Lelegard | |
| # BSD-2-Clause license, see LICENSE.txt file or https://tsduck.io/license | |
| # | |
| # GitHub Actions configuration file : Nightly builds | |
| # | |
| # Builds installers for Windows and Ubuntu. Build programmer's doc package. | |
| # Upload them all as artifacts of this workflow. | |
| # | |
| #----------------------------------------------------------------------------- | |
| name: Nightly build | |
| on: | |
| # Trigger the workflow every day at 00:40 UTC. | |
| schedule: | |
| - cron: '40 0 * * *' | |
| # Allow manual trigger. | |
| workflow_dispatch: | |
| jobs: | |
| # Get current TSDuck version in the repo and latest nightly builds on tsduck.io. | |
| init: | |
| name: Initialization | |
| runs-on: ubuntu-latest | |
| outputs: | |
| rebuild: ${{ steps.check.outputs.rebuild }} | |
| retention_days: ${{ steps.check.outputs.retention }} | |
| steps: | |
| - name: Install prerequisites | |
| run: sudo apt install -y curl jq | |
| - name: Get TSDuck repo | |
| uses: actions/checkout@master | |
| - name: Check if rebuild is necessary | |
| id: check | |
| run: | | |
| remote_version=$(curl --retry 5 --retry-all-errors -sSL https://tsduck.io/download/prerelease/get-versions | jq -r '.latest?'; true) | |
| version=$(scripts/get-version-from-sources.py) | |
| [[ "$version" == "$remote_version" ]] && rebuild=false || rebuild=true | |
| retention=${{ vars.ARTIFACT_RETENTION_DAYS || 5 }} | |
| echo "Repository: ${{ github.repository }}" | |
| echo "Current version: $version, latest on tsduck.io: $remote_version" | |
| echo "Rebuild: $rebuild" | |
| echo "Artifacts retention days: $retention" | |
| echo "rebuild=$rebuild" >>$GITHUB_OUTPUT | |
| echo "retention=$retention" >>$GITHUB_OUTPUT | |
| echo "$version" >version.txt | |
| - name: Upload version | |
| if: fromJSON(steps.check.outputs.rebuild) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: version | |
| path: version.txt | |
| retention-days: ${{ fromJSON(steps.check.outputs.retention) }} | |
| # Build on Windows. | |
| windows: | |
| name: Windows build | |
| if: github.repository == 'tsduck/tsduck' | |
| needs: [init] | |
| uses: ./.github/workflows/release-windows.yml | |
| with: | |
| build: ${{ fromJSON(needs.init.outputs.rebuild) }} | |
| build_x64: true | |
| build_arm64: false | |
| runner: windows-latest | |
| retention_days: ${{ fromJSON(needs.init.outputs.retention_days) }} | |
| # Build on Linux. | |
| linux: | |
| name: Linux build | |
| if: github.repository == 'tsduck/tsduck' | |
| needs: [init] | |
| uses: ./.github/workflows/release-linux.yml | |
| with: | |
| build: ${{ fromJSON(needs.init.outputs.rebuild) }} | |
| arch: x64 | |
| distro: ubuntu | |
| runner: ubuntu-latest | |
| image: ubuntu:latest | |
| setup_command: apt update; apt install -y sudo git lsb-release | |
| command_list_artifact: true | |
| retention_days: ${{ fromJSON(needs.init.outputs.retention_days) }} | |
| # Build documentation. | |
| doc: | |
| name: Documentation build | |
| if: github.repository == 'tsduck/tsduck' | |
| needs: [init] | |
| uses: ./.github/workflows/release-docs.yml | |
| with: | |
| build: ${{ fromJSON(needs.init.outputs.rebuild) }} | |
| build_guides: true | |
| build_doxy: true | |
| retention_days: ${{ fromJSON(needs.init.outputs.retention_days) }} | |
| # Trigger the update on tsduck.io. | |
| update: | |
| name: Update nightly builds on tsduck.io | |
| if: github.repository == 'tsduck/tsduck' && fromJSON(needs.init.outputs.rebuild) | |
| needs: [linux, windows, doc] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install dependencies | |
| run: sudo apt install -y curl jq | |
| - name: Trigger download | |
| run: | | |
| curl --retry 5 --retry-all-errors -sL -H 'X-Upload-Credentials: ${{ secrets.UPLOAD_CREDENTIALS }}' https://tsduck.io/download/prerelease/get-nightly-builds -o update.log | |
| jq . update.log || cat update.log |