1414 - .github/workflows/build.yml
1515 # Allows you to run this workflow manually from the Actions tab
1616 workflow_dispatch :
17-
17+
1818permissions : {} # none
1919
2020# A workflow run is made up of one or more jobs that can run sequentially or in parallel
2424 permissions :
2525 contents : write # for softprops/action-gh-release to create GitHub release
2626 # The type of runner that the job will run on
27- runs-on : ubuntu-latest
27+ # runs-on: ubuntu-latest
28+ runs-on : ubuntu-24.04
2829
2930 # Steps represent a sequence of tasks that will be executed as part of the job
3031 steps :
@@ -34,36 +35,57 @@ jobs:
3435 with :
3536 fetch-depth : 10
3637
37- - name : Install depencies
38- run : |
39- sudo apt update
40- sudo apt install ccache libssl-dev u-boot-tools python3-mako debhelper fakeroot gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu make device-tree-compiler libncurses5-dev
41-
4238 - name : Setup env
4339 run : |
4440 echo "DT=$(date +'%Y-%m-%d_%H%M')" >> $GITHUB_ENV
4541 echo "KERNELVER=$(make kernelversion)" >> $GITHUB_ENV
4642 echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
43+ echo "UBUNTU_MAJOR_VERSION=$(cat /etc/issue | head -1|sed -e 's/^Ubuntu \([0-9]\+\).*$/\1/')" >> $GITHUB_ENV
44+
45+ - name : Print env
46+ run : |
47+ echo $BRANCH $KERNELVER $DT
48+ echo $UBUNTU_MAJOR_VERSION
49+
50+ - name : update apt-repos (u22)
51+ if : env.UBUNTU_MAJOR_VERSION == '22'
52+ run : |
53+ cat /etc/apt/sources.list
54+ sudo sed -i.bak -e 's/^deb/deb [ arch=amd64,i386 ]/' /etc/apt/sources.list
55+ #deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ jammy main universe
56+ echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports jammy main universe" | sudo tee -a /etc/apt/sources.list
57+
58+
59+ - name : update apt-repos (u24)
60+ if : env.UBUNTU_MAJOR_VERSION == '24'
61+ run : |
62+ sudo cp /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ports.sources
63+ sudo sed -i.bak -e 's/^\(Suites:.*\)$/\1\nArchitectures: amd64 i386/' /etc/apt/sources.list.d/ubuntu.sources
64+ sudo sed -i.bak -e 's/^URIs:.*$/URIs: http:\/\/ports.ubuntu.com\/ubuntu-ports\//' /etc/apt/sources.list.d/ports.sources
65+ sudo sed -i -e 's/^\(Suites:.*\)$/\1\nArchitectures: armhf arm64/' /etc/apt/sources.list.d/ports.sources
66+ cat /etc/apt/sources.list.d/ports.sources
67+
68+ - name : Install depencies
69+ run : |
70+ sudo dpkg --add-architecture armhf
71+ sudo dpkg --add-architecture arm64
72+ sudo apt update
73+ sudo apt install ccache libssl-dev:armhf libssl-dev:arm64 build-essential u-boot-tools python3-mako debhelper fakeroot gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu make device-tree-compiler libncurses5-dev libelf-dev
4774
4875 - name : Generate Changelog
4976 run : |
5077 echo "# CI-Build for $BRANCH ($KERNELVER)" > ${{ github.workspace }}-CHANGELOG.txt
5178 echo "last commits:" >> ${{ github.workspace }}-CHANGELOG.txt
5279 git log --pretty=format:"%h %ad %s %d by %an" --date=short >> ${{ github.workspace }}-CHANGELOG.txt
5380
54- - name : Print env
55- run : |
56- echo $BRANCH $KERNELVER $DT
57-
5881 - name : Setup cache
5982 id : cache
6083 uses : actions/cache@v4
6184 with :
62- path : ~/.ccache
63- key : ${{ runner.os }}-ccache
85+ path : ~/.cache/ ccache/
86+ key : ${{ runner.os }}-ccache-${{ github.ref_name }}
6487 restore-keys : |
65- ${{ runner.os }}-ccache
66- ${{ runner.os }}-ccache-
88+ ${{ runner.os }}-ccache-${{ github.ref_name }}
6789
6890 - name : Build for bananapi-r2
6991 run : |
7799 bash build.sh pack
78100
79101 - name : Build for bananapi-r64
80- run : |
81- sed -i 's/#\ (board=bpi-r64\ )/\1/' build.conf #change board to r64
102+ run : |
103+ sed -ri 's/^# (board=bpi-r64)/\1/' build.conf #change board to r64
82104 bash build.sh importconfig
83105 bash build.sh build
84106 bash build.sh cryptodev
88110 bash build.sh pack
89111
90112 - name : Upload binaries to release
91- if : endsWith(github.ref,'-main')
113+ if : endsWith(github.ref,'-main')
92114 # uses: marvinpinto/action-automatic-releases@latest
93115 # with:
94116 # repo_token: "${{ secrets.GITHUB_TOKEN }}"
0 commit comments