Nightly #828
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: 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-20.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 |