1414 strategy :
1515 fail-fast : false
1616 matrix :
17- image_tag : [bullseye, bookworm, trixie, sid]
17+ image_tag : [bullseye, bookworm, trixie, forky, sid]
1818 architecture : [amd64]
1919 container : debian:${{ matrix.image_tag }}
2020 steps :
@@ -29,13 +29,37 @@ jobs:
2929 # create a .git folder or .git.config. The Problem Matcher looks for
3030 # .git/config to find where the root of the repo is, so it must be
3131 # present.
32- - name : Install Git
33- run : apt-get -y install git
32+ - name : Install Git and lsb-release
33+ run : apt-get -y install git lsb-release
3434 - uses : actions/checkout@v4
3535 with :
36+ fetch-depth : 0 # Fetch all tags for generating OLA_BUILD_NAME
3637 persist-credentials : false
38+ - name : Generate build name
39+ shell : bash
40+ run : |
41+ chown root:root . # workaround Git security precaution, see https://github.com/actions/runner-images/issues/6775
42+ export OLA_BUILD_NAME=$(./scripts/build_name.sh)
43+ # No docker number tag for testing, so must use lsb_release
44+ export OLA_DEBIAN_BUILD_VERSION=$(./scripts/build_name.sh --debian)
45+
46+ echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_OUTPUT
47+ echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_ENV # Set build name globally so that modifications don't cause -dirty
48+ echo "OLA_DEBIAN_BUILD_VERSION=$OLA_DEBIAN_BUILD_VERSION" >> $GITHUB_OUTPUT
49+
50+ echo "Build name: $OLA_BUILD_NAME"
51+ echo "Debian Build Version: $OLA_DEBIAN_BUILD_VERSION"
52+ id : generate-build-name
3753 - name : Install build tools
38- run : apt-get -y install devscripts adduser fakeroot sudo
54+ run : apt-get -y install devscripts adduser fakeroot sudo equivs
55+ - name : Create Debian version for build
56+ shell : bash
57+ run : |
58+ DEBFULLNAME="GitHub Actions" DEBEMAIL=actions@github.com \
59+ debchange --force-bad-version \
60+ --newversion ${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }} \
61+ "GitHub Actions Build \
62+ ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
3963 - name : Install build dependencies
4064 run : mk-build-deps -t "apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends" -i -r
4165 - name : Set up build user
4468 chown -R builduser:builduser .
4569 chown builduser:builduser ..
4670 - name : Build
47- run : sudo -u builduser dpkg-buildpackage -b -rfakeroot -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }}
71+ run : sudo -u builduser env "OLA_BUILD_NAME=$OLA_BUILD_NAME" dpkg-buildpackage -v${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }} -b -rfakeroot -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }}
4872 - name : Move built files
4973 if : always()
5074 run : |
6286 - uses : actions/upload-artifact@v4
6387 if : always()
6488 with :
65- name : ola-built-debian-${{ matrix.image_tag }}-${{ matrix.architecture }}
89+ name : ola-built-debian-${{ matrix.image_tag }}-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }}
6690 path : ./built
6791 debian-test :
6892 name : ' Debian Test ${{ matrix.image_tag }} ${{ matrix.architecture }}'
@@ -72,17 +96,31 @@ jobs:
7296 strategy :
7397 fail-fast : false
7498 matrix :
75- image_tag : [bullseye, bookworm, trixie, sid]
99+ image_tag : [bullseye, bookworm, trixie, forky, sid]
76100 architecture : [amd64]
77101 container : debian:${{ matrix.image_tag }}
78102 steps :
103+ - name : Update package database
104+ run : apt-get update -y
105+ - name : Install Git and lsb-release
106+ run : apt-get -y install git lsb-release
79107 - uses : actions/checkout@v4
80108 with :
109+ fetch-depth : 0 # Fetch all tags for generating OLA_DEBIAN_BUILD_VERSION
81110 persist-credentials : false
111+ - name : Generate build name # Job step outputs can't be passed between builds for matrix jobs, so we re-generate
112+ shell : bash
113+ run : |
114+ chown root:root . # workaround Git security precaution, see https://github.com/actions/runner-images/issues/6775
115+ # No docker number tag for testing, so must use lsb_release
116+ export OLA_DEBIAN_BUILD_VERSION=$(./scripts/build_name.sh --debian)
117+ echo "OLA_DEBIAN_BUILD_VERSION=$OLA_DEBIAN_BUILD_VERSION" >> $GITHUB_OUTPUT
118+ echo "Debian Build Version: $OLA_DEBIAN_BUILD_VERSION"
119+ id : generate-build-name
82120 - name : Download build artifact
83121 uses : actions/download-artifact@v4
84122 with :
85- name : ola-built-debian-${{ matrix.image_tag }}-${{ matrix.architecture }}
123+ name : ola-built-debian-${{ matrix.image_tag }}-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }}
86124 path : built
87125 - name : Display structure of artifact files
88126 run : ls -alR
96134 - uses : actions/upload-artifact@v4
97135 if : always() # Always upload the test output, even on failed tests
98136 with :
99- name : ola-test-output-debian-${{ matrix.image_tag }}-${{ matrix.architecture }}
137+ name : ola-test-output-debian-${{ matrix.image_tag }}-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }}
100138 path : test-output
0 commit comments