@@ -11,61 +11,38 @@ jobs:
1111 runs-on : ubuntu-latest
1212
1313 steps :
14+ - name : 📁 Checkout
15+ uses : actions/checkout@v4
1416
15- # --------------------------------------------collect--------------------------------------------
16- - uses : actions/checkout@v3
17-
18- - name : 🏷️ Get infomations
19- run : |
20- tag="${GITHUB_REF#refs/tags/}"
21- echo "tag=$tag" >> $GITHUB_ENV
22- echo "pkgname=cppp-reiconv-$tag" >> $GITHUB_ENV
23- echo "srcdir=$(pwd)" >> $GITHUB_ENV
17+ - name : 🧰 Setup Rubisco
18+ id : rubisco
19+ uses : cppp-project/rubisco@main
20+ with :
21+ host : x86_64-linux-gnu
2422
25- - name : 📁 Collect dependencies
26- run : |
27- sudo apt-get update
28- sudo apt-get install p7zip-full zip xz-utils -y
29- sudo apt-get install gperf cmake gcc python3 -y
30-
31- # --------------------------------------------build--------------------------------------------
32- - name : 🧳 Prepare for source distribution building
33- run : |
34- mkdir -p ./dist
35- ./setup.sh
36-
37- - name : 🛠️ Build source distribution
23+ - name : 📦 Build source distribution
3824 run : |
39- ./cpppdist.py
40-
41- - name : 📦 Make packages
42- run : |
43- tar cvf ${{ env.pkgname }}.tar ${{ env.pkgname }}
44- zip -r -9 dist/${{ env.pkgname }}.zip ${{ env.pkgname }}
45- 7z a dist/${{ env.pkgname }}.7z ${{ env.pkgname }}
46- xz -c -9 -k ${{ env.pkgname }}.tar > dist/${{ env.pkgname }}.tar.xz
47- gzip -c -9 -k ${{ env.pkgname }}.tar > dist/${{ env.pkgname }}.tar.gz
25+ rubisco dist
4826
27+ # Rubisco will support it later.
28+ - name : 📦 Generate checksum
29+ run : |
4930 cd dist
50- for i in $(ls) ; do md5sum $i > $i.md5 ; done
31+ for i in $(ls) ; do sha256sum $i > $i.sha256 ; done
5132 cd ..
52-
53- # --------------------------------------------publish--------------------------------------------
5433
5534 - name : ⬆️ Create release and upload assets
5635 uses : softprops/action-gh-release@v1
5736 with :
58- tag_name : ${{ env .tag }}
37+ tag_name : ${{ steps.rubisco.outputs .tag }}
5938 files : ./dist/*
6039
6140 build-linux :
62-
63- needs : build-dist
6441
6542 strategy :
6643 fail-fast : false
6744 matrix :
68- arch : [
45+ host : [
6946 aarch64-linux-gnu,
7047 alpha-linux-gnu,
7148 arm-linux-gnueabi,
@@ -75,87 +52,72 @@ jobs:
7552 mips64-linux-gnuabi64,
7653 mips64el-linux-gnuabi64,
7754 mipsel-linux-gnu,
78- mipsisa32r6-linux-gnu,
79- mipsisa32r6el-linux-gnu,
80- mipsisa64r6-linux-gnuabi64,
81- mipsisa64r6el-linux-gnuabi64,
8255 powerpc-linux-gnu,
8356 powerpc64-linux-gnu,
84- powerpc64le-linux-gnu,
8557 riscv64-linux-gnu,
8658 sh4-linux-gnu,
8759 x86_64-linux-gnu
8860 ]
89-
61+
9062 runs-on : ubuntu-latest
91-
63+
9264 steps :
93-
94- # --------------------------------------------collect--------------------------------------------
95- - name : 🏷️ Get infomations
96- run : |
97- tag="${GITHUB_REF#refs/tags/}"
98- echo "tag=$tag" >> $GITHUB_ENV
99- echo "pkgname=cppp-reiconv-$tag" >> $GITHUB_ENV
100- echo "srcdir=$(pwd)" >> $GITHUB_ENV
65+ - name : 📁 Checkout
66+ uses : actions/checkout@v4
67+
68+ - name : 🧰 Setup Rubisco
69+ id : rubisco
70+ uses : cppp-project/rubisco@main
71+ with :
72+ host : ${{ matrix.host }}
10173
74+ # Rubisco don't support setup cross-compiler now.
10275 - name : 📁 Collect dependencies
10376 run : |
10477 sudo apt-get update
105- sudo apt-get install p7zip-full zip xz-utils wget -y
106- sudo apt-get install gperf cmake -y
107- if [ "${{ matrix.arch }}" = "x86_64-linux-gnu" ] ;
78+ if [ "${{ matrix.host }}" = "x86_64-linux-gnu" ] ;
10879 then
10980 sudo apt-get install gcc g++ -y ;
11081 else
111- sudo apt-get install gcc-${{ matrix.arch }} g++-${{ matrix.arch }} -y ;
82+ sudo apt-get install gcc-${{ matrix.host }} g++-${{ matrix.host }} -y ;
11283 fi
113-
114- - name : 📁 Get source distribution tarball
115- run : |
116- wget https://github.com/${{ github.repository }}/releases/download/${{ env.tag }}/${{ env.pkgname }}.tar.gz
117- tar zxvf ${{ env.pkgname }}.tar.gz
118- mv ${{ env.pkgname }}/* .
119-
120- # --------------------------------------------build--------------------------------------------
121- - name : 🧳 Prepare for binary distribution building
84+
85+ - name : 🧳 Prepare for building
12286 run : |
87+ mkdir -p ${{ steps.rubisco.outputs.pkgname }}-${{ matrix.host }}
12388 mkdir -p dist
12489
12590 - name : 🛠️ Build binary distribution
12691 run : |
12792 export C_COMPILER="gcc"
12893 export CXX_COMPILER="g++"
12994 export LINKER="ld"
130- export CC_CROSS="/usr/bin/${{ matrix.arch }}-$C_COMPILER"
131- export CXX_CROSS="/usr/bin/${{ matrix.arch }}-$CXX_COMPILER"
132- export LD="/usr/bin/${{ matrix.arch }}-$LINKER"
95+ export CC_CROSS="/usr/bin/${{ matrix.host }}-$C_COMPILER"
96+ export CXX_CROSS="/usr/bin/${{ matrix.host }}-$CXX_COMPILER"
97+ export LD="/usr/bin/${{ matrix.host }}-$LINKER"
13398
13499 mkdir build
135100 cd build
136- cmake .. -DCMAKE_INSTALL_PREFIX=${{ env. srcdir }}/${{ env. pkgname }}-${{ matrix.arch }} -DCMAKE_C_COMPILER=$CC_CROSS -DCMAKE_CXX_COMPILER=$CXX_CROSS -DCMAKE_LINKER=$LD
137- cmake --build . --config=Release
138- cmake --install .
101+ cmake .. -DCMAKE_INSTALL_PREFIX=" ${{ steps.rubisco.outputs. srcdir }}/${{ steps.rubisco.outputs. pkgname }}-${{ matrix.host }}" -DCMAKE_C_COMPILER=$CC_CROSS -DCMAKE_CXX_COMPILER=$CXX_CROSS -DCMAKE_LINKER=$LD
102+ cmake --build . --config=Release -j $(nproc)
103+ cmake --install . --config=Release
139104 cd ..
140105
141106 - name : 📦 Make packages
142107 run : |
143- tar cvf ${{ env.pkgname }}-${{ matrix.arch }}.tar ${{ env.pkgname }}-${{ matrix.arch }}
144- zip -r -9 dist/${{ env.pkgname }}-${{ matrix.arch }}.zip ${{ env.pkgname }}-${{ matrix.arch }}
145- 7z a dist/${{ env.pkgname }}-${{ matrix.arch }}.7z ${{ env.pkgname }}-${{ matrix.arch }}
146- xz -c -9 -k ${{ env.pkgname }}-${{ matrix.arch }}.tar > dist/${{ env.pkgname }}-${{ matrix.arch }}.tar.xz
147- gzip -c -9 -k ${{ env.pkgname }}-${{ matrix.arch }}.tar > dist/${{ env.pkgname }}-${{ matrix.arch }}.tar.gz
108+ tar cvf dist/${{ steps.rubisco.outputs.pkgname }}-${{ matrix.host }}.tar ${{ steps.rubisco.outputs.pkgname }}-${{ matrix.host }}
109+ xz -9 dist/${{ steps.rubisco.outputs.pkgname }}-${{ matrix.host }}.tar
148110
111+ - name : 📦 Generate checksum
112+ run : |
149113 cd dist
150- for i in $(ls) ; do md5sum $i > $i.md5 ; done
114+ for i in $(ls) ; do sha256sum $i > $i.sha256 ; done
151115 cd ..
152-
153- # --------------------------------------------publish--------------------------------------------
154116
155117 - name : ⬆️ Create release and upload assets
156118 uses : softprops/action-gh-release@v1
157119 with :
158- tag_name : ${{ env .tag }}
120+ tag_name : ${{ steps.rubisco.outputs .tag }}
159121 files : ./dist/*
160122
161123 build-macos :
0 commit comments