diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index c6feedbc1..8dd31b5d7 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -13,7 +13,14 @@ on: - '**.txt' release: types: [published] + schedule: + - cron: '0 0 * * *' workflow_dispatch: + inputs: + release_nightly: + description: Set to true to trigger the nightly build (will overwrite artifacts in the Nightly release!) + required: false + default: 'false' env: alire_index: "" @@ -449,4 +456,104 @@ jobs: upload_url: ${{ needs.release-info.outputs.upload-url }} asset_path: alr.AppImage asset_name: alr-${{ needs.release-info.outputs.version-without-v }}-x86_64.AppImage - asset_content_type: application/x-elf \ No newline at end of file + asset_content_type: application/x-elf + + ################### + # release-nightly # + ################### + # Run it when the pr name contains 'nightly' + release-nightly: + name: Nightly release on ${{ matrix.platform.id }} + if: > + github.event_name == 'schedule' + || github.event.inputs.release_nightly != 'false' + || contains(github.event.pull_request.title, 'nightly') + needs: [build, build-macos-universal, release-info] + runs-on: ${{ matrix.platform.os }} + + strategy: + fail-fast: false + matrix: + platform: + - os: macos-13 + id: x86_64-macos + + - os: macos-latest + id: aarch64-macos + + - os: macos-latest + id: universal-macos + + - os: ubuntu-22.04 + id: x86_64-linux + + - os: ubuntu-24.04-arm + id: aaarch64-linux + + - os: windows-latest + id: x86_64-windows + + steps: + + - name: Retrieve binary artifact + uses: actions/download-artifact@v4 + with: + name: alr-bin-${{ matrix.platform.id }}.zip + + - name: Install zip (Windows) + if: matrix.platform.os == 'windows-latest' + run: choco install zip + + - name: Get date + id: date + run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + shell: bash + + - name: Get metadata + run: | + touch alr-date-is-${{steps.date.outputs.date}}.txt + touch alr-commit-is-${{github.sha}}.txt + shell: bash + + - name: Package binaries + run: zip alr-nightly-bin-${{matrix.platform.id}}.zip bin/alr* LICENSE.txt alr-*.txt + + - name: Upload to release + uses: pyTooling/Actions/releaser/composite@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + files: | + alr-nightly-*.zip + tag: nightly + rm: false + + ############################ + # release-nightly-appimage # + ############################ + + release-nightly-appimage: + name: Nightly AppImage + if: > + github.event_name == 'schedule' + || github.event.inputs.release_nightly != 'false' + || contains(github.event.pull_request.title, 'nightly') + needs: [appimage] + runs-on: ubuntu-22.04 + + steps: + + - name: Retrieve binary artifact + uses: actions/download-artifact@v4 + with: + name: alr-${{needs.appimage.outputs.short_sha}}-x86_64.AppImage.zip + + - name: Rename binary + run: mv alr.AppImage alr-nightly-x86_64.AppImage + + - name: Upload to release + uses: pyTooling/Actions/releaser/composite@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag: nightly + rm: false + files: alr-nightly-x86_64.AppImage diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index 31030288e..000000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,197 +0,0 @@ -name: Nightly -# Create a nightly build from master and upload to the corresponding pre-release - -on: - push: - branches: - - 'feat/nightly' # Allows to be tested before merging - - 'fix/nightly' - - 'feat/ubuntu-arm' - schedule: - - cron: '0 0 * * *' - workflow_dispatch: - -jobs: - - build: - name: ${{ matrix.os }} - - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false # Attempt to generate as many of them as possible - matrix: - os: - - macos-13 # x64 - - macos-14 # arm64 - - ubuntu-22.04 # oldest supported to be able to run on those - - ubuntu-24.04-arm # oldest with ARM arch - - windows-latest - - steps: - - name: Check out repository - uses: actions/checkout@v4 - with: - submodules: true - - # Determine special case (we need an OS GNAT) - - name: Need OS GNAT? - id: need_os_gnat - if: matrix.os == 'ubuntu-24.04-arm' - run: echo "need_os_gnat=true" >> $GITHUB_OUTPUT - - # Toolchain according to arch - - - name: Install Alire toolchain - if: steps.need_os_gnat.outputs.need_os_gnat != 'true' - uses: alire-project/alr-install@v2 - with: - crates: gnat_native gprbuild - prefix: alire_prefix - - - name: Install Ubuntu ARM toolchain - if: steps.need_os_gnat.outputs.need_os_gnat == 'true' - run: sudo apt-get install -y gnat gprbuild - # GNAT 10 has a bug that fails in the testsuite - - - name: Check toolchain architecture - uses: mosteo-actions/gnat-toolchain-arch-checker@v1 - - - name: Install Python 3.x (required for the testsuite) - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - # Determine whether to disable docker (cannot run on Ubuntu 24 ARM) - - - name: Set ALIRE_TESTSUITE_DISABLE_DOCKER - if: startsWith(matrix.os, 'ubuntu-24.04') - run: echo "ALIRE_TESTSUITE_DISABLE_DOCKER=true" >> $GITHUB_ENV - shell: bash - - - name: Run test script - run: scripts/ci-github.sh - shell: bash - - # Ascertain whether alr can run without the toolchain that built it - - - name: Uninstall Ubuntu ARM GNAT - if: steps.need_os_gnat.outputs.need_os_gnat == 'true' - run: sudo apt-get remove -y gnat gprbuild - shell: bash - - - name: Check standalone alr - uses: mosteo-actions/alr-standalone-checker@v1 - with: - alr_path: bin - toolchain_path: alire_prefix - - - name: Upload logs (if failed) - if: failure() - uses: actions/upload-artifact@v4 - with: - name: e3-log-linux.zip - path: testsuite/out - - - name: Select arch name - id: get_arch - shell: bash - run: | - case ${{ runner.arch }} in - X64) echo "arch=x86_64" >> $GITHUB_OUTPUT ;; - ARM64) echo "arch=aarch64" >> $GITHUB_OUTPUT ;; - *) echo "Unknown architecture, failing..." && exit 1 ;; - esac - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: alr-bin-${{ matrix.os }}-${{steps.get_arch.outputs.arch}}.zip - path: | - bin/alr* - LICENSE.txt - - # Release steps start here - - - name: Get date - id: date - run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - shell: bash - - - name: Get metadata - run: | - touch alr-date-is-${{steps.date.outputs.date}}.txt - touch alr-commit-is-${{github.sha}}.txt - shell: bash - - - name: Package binaries (Linux) - if: startsWith(matrix.os, 'ubuntu') - run: zip alr-nightly-bin-${{steps.get_arch.outputs.arch}}-linux.zip bin/alr* LICENSE.txt alr-*.txt - - - name: Package binaries (macOS/x64) - if: startsWith(matrix.os, 'macos') - run: zip alr-nightly-bin-${{steps.get_arch.outputs.arch}}-macos.zip bin/alr* LICENSE.txt alr-*.txt - - # There's no zip on windows - - name: Install zip (Windows) - if: startsWith(matrix.os, 'windows') - run: choco install zip - - - name: Package binaries (Windows) - if: startsWith(matrix.os, 'windows') - run: zip alr-nightly-bin-${{steps.get_arch.outputs.arch}}-windows.zip bin/alr* LICENSE.txt alr-*.txt - - - name: Upload to release - uses: pyTooling/Actions/releaser/composite@main - with: - token: ${{ secrets.GITHUB_TOKEN }} - files: | - alr-nightly-*.zip - tag: nightly - rm: false - - build-macos-universal: - runs-on: macos-latest - needs: [build] - steps: - - name: Install Python 3.x (required for releaser) - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - - name: download x86_64 - uses: robinraju/release-downloader@v1 - with: - fileName: '*-x86_64-macos.zip' - latest: true - preRelease: true - out-file-path: 'x86_64' - extract: true - - - name: download aarch64 - uses: robinraju/release-downloader@v1 - with: - latest: true - preRelease: true - fileName: '*-aarch64-macos.zip' - out-file-path: 'aarch64' - extract: true - - - name: Create universal binary - run: | - mkdir universal - # copy extra files from aarch64 (and bin/alr, to be overwritten) - cp -pR aarch64/* universal - lipo x86_64/bin/alr aarch64/bin/alr -create -output universal/bin/alr - ls -l universal/bin/alr - chmod +x universal/bin/alr - (cd universal; zip ../alr-nightly-bin-universal-macos.zip bin/alr LICENSE.txt alr-*.txt) - - - name: Upload to release - uses: pyTooling/Actions/releaser/composite@main - with: - token: ${{ secrets.GITHUB_TOKEN }} - files: | - alr-nightly-bin-universal-macos.zip - tag: nightly - rm: false