Skip to content

Commit

Permalink
Use git commit id as build part in alr version
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Feb 16, 2024
1 parent a4713fd commit 045466a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ jobs:
with:
submodules: true

- name: Install Python 3.x # required by testsuite and scripts
uses: actions/setup-python@v2
with:
python-version: '3.x'

# Use a stock alr to make the latest toolchain available

- name: Install FSF toolchain
Expand Down Expand Up @@ -72,11 +77,6 @@ jobs:
# Run the testsuite with the just build alr. The testsuite picks the proper
# alr in the ./bin/alr location.

- name: Install Python 3.x # required by testsuite
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install e3
run: pip install --upgrade -r testsuite/requirements.txt

Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,20 @@ jobs:
with:
submodules: true


- name: Install Python 3.x (required for the testsuite)
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install FSF toolchain
uses: alire-project/alr-install@v1
with:
crates: gnat_native gprbuild

- name: Fingerprint build
run: python3 scripts/version-patcher.py

- name: Build alr
run: gprbuild -j0 -p -P alr_env

Expand All @@ -41,11 +50,6 @@ jobs:
- name: install tar from msys2 (Git tar in Actions VM does not seem to work)
run: C:\Users\runneradmin\AppData\Local\alire\msys64\usr\bin\pacman --noconfirm -S tar

- name: Install Python 3.x (required for the testsuite)
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Run test script
run: scripts/ci-github.sh
shell: bash
Expand Down
6 changes: 6 additions & 0 deletions scripts/ci-github.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# To be run from the repository root

trap 'echo "ERROR at line ${LINENO} (code: $?)" >&2' ERR
trap 'echo "Interrupted" >&2 ; exit 1' INT

Expand All @@ -13,6 +15,10 @@ pushd $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
. ../dev/functions.sh
popd

# Fingerprint the build. The commit ID will appear as the version build part.
echo "Building from commit: $(git rev-parse HEAD)"
python3 scripts/version-patcher.py

# Build alr
export ALIRE_OS=$(get_OS)
gprbuild -j0 -p -P alr_env
Expand Down
2 changes: 1 addition & 1 deletion src/alire/alire-version.ads
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package Alire.Version with Preelaborate is
-- be replaced by `alr build` with the current commit, and appended with
-- "_or_later" after build.

Current : constant String := "2.0-beta2+92896bd3_or_later";
Current : constant String := "2.0-beta2+277e6a52_dirty";
-- 2.0.0-b1: first public release on the 2.0 branch
-- 1.2.1: build switches fix and other minor assorted fixes
-- 1.2.0: rpm speed-up, silence propagation warning, early switch parse
Expand Down

0 comments on commit 045466a

Please sign in to comment.