diff --git a/.github/workflows/building-deb-base.yml b/.github/workflows/building-deb-base.yml new file mode 100755 index 0000000..c782631 --- /dev/null +++ b/.github/workflows/building-deb-base.yml @@ -0,0 +1,137 @@ +name: Building GXDE Package + +on: + workflow_call: + secrets: + PASSWD: + required: true + USERS: + required: true + HOST: + required: true + UPATH: + required: true + UPROGRAM: + required: true + UPORT: + required: true + + inputs: + arch: + type: string + description: 'Rootfs Arch' + required: true + + rootfs-codename: + type: string + description: 'Rootfs Codename' + required: true + + rootfs-source: + type: string + description: 'Rootfs Source Url' + required: true + + gxde-codename: + type: string + description: 'GXDE OS Codename' + required: true + + gxde-codename-upload: + type: string + description: 'GXDE OS Codename' + required: true + + display-name: + required: false + type: string + + + +env: + REPOSITORY: https://github.com/GXDE-OS/GXDE + BOTTLEPATH: system-bottle + +jobs: + build: + name: ${{ inputs.display-name || 'Build Job' }} + runs-on: ubuntu-24.04 + steps: + # 由于默认的 Ubuntu 环境只有 17G 左右的剩余空间,所以我们需要先利用如下 action 对编译环境进行扩容 + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + # 这个值是保留给系统的空间大小,之前设置太小,总会在安装依赖或者编译过程中报设备空间不足的错误而导致编译失败 + root-reserve-mb: 4096 + swap-size-mb: 512 + remove-dotnet: 'true' + remove-docker-images: 'true' + remove-codeql: 'true' + remove-haskell: 'true' + remove-android: 'true' + + - name: Clone Repository To Get Script + run: | + #apt update + #apt install sudo git -y + git clone $REPOSITORY --depth=1 + mv $(basename $REPOSITORY)/* . -v + mv $(basename $REPOSITORY)/.* . -v | true + + - name: Configure Base System + run: | + bash .github/workflows/configure-building-enviroment-base-system.sh ${{ inputs.arch }} \ + ${{ inputs.rootfs-codename }} \ + $REPOSITORY \ + https://github.com/$GITHUB_REPOSITORY \ + ${{ inputs.rootfs-source }} + + - name: Building ${{ GITHUB.repository }} + run: | + gitPath=$(basename $GITHUB_REPOSITORY) + if [[ -f system-bottle/$gitPath/debian/control ]]; then + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=${{ inputs.gxde-codename }} GO111MODULE=off dpkg-buildpackage -b + else + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=${{ inputs.gxde-codename }} GO111MODULE=off bash build-deb.sh + fi + cp $BOTTLEPATH/*.deb . -rv + sudo rename 's/\.deb$/_${{ inputs.gxde-codename }}.deb/' *.deb + + - name: Remove Debug Package + run: | + cd $BOTTLEPATH + echo -e "ls -1 | grep dbgsym | grep .deb | grep -v dtk | grep -v qt | grep -v dock | grep -v gxtk\nexit 0" | sudo tee remove-deb.sh + removeDeb=$(bash remove-deb.sh) + sudo rm -rf $removeDeb + + - name: Pack tar + run: | + cd $BOTTLEPATH + sudo tar -cvf ../deb-$(date +%s).tar *.deb + + - name: Push + env: + UPASSWD: ${{ secrets.PASSWD }} + UUSERS: ${{ secrets.USERS }} + UHOST: ${{ secrets.HOST }} + UPATH: ${{ secrets.UPATH }} + UPROGRAM: ${{ secrets.UPROGRAM }} + UPORT: ${{ secrets.UPORT }} + run: | + sudo apt update + sudo apt install sshpass -y + mkdir -p ~/.ssh/ + ssh-keyscan -p $UPORT -H $UHOST >> ~/.ssh/known_hosts + tarName=$(ls | grep .tar | head -n 1) + sshpass -p "$UPASSWD" rsync -e "ssh -p $UPORT" $tarName $UUSERS@$UHOST:$UPATH + sshpass -p "$UPASSWD" ssh $UUSERS@$UHOST -p $UPORT $UPROGRAM ${{ inputs.gxde-codename-upload }} $UPATH/$tarName > /dev/null + + - name: Create Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOCKEN_GITHUB }} + with: + files: | + *.deb + generate_release_notes: true \ No newline at end of file diff --git a/.github/workflows/building-deb-meimei.yml b/.github/workflows/building-deb-meimei.yml index 1e0da1a..40df47b 100755 --- a/.github/workflows/building-deb-meimei.yml +++ b/.github/workflows/building-deb-meimei.yml @@ -1,4 +1,4 @@ -name: Building GXDE Testing Package (meimei) +name: Building GXDE Package (meimei) run-name: Building ${{ GITHUB.REPOSITORY }} on: @@ -52,7 +52,12 @@ jobs: - name: Building ${{ GITHUB.repository }} run: | - env gitPath=$(basename $GITHUB_REPOSITORY) bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=meimei GO111MODULE=off dpkg-buildpackage -b + gitPath=$(basename $GITHUB_REPOSITORY) + if [[ -f system-bottle/$gitPath/debian/control ]]; then + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=meimei GO111MODULE=off dpkg-buildpackage -b + else + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=meimei GO111MODULE=off bash build-deb.sh + fi cp $BOTTLEPATH/*.deb . -rv sudo rename 's/\.deb$/_meimei.deb/' *.deb diff --git a/.github/workflows/building-deb-tianlu.yml b/.github/workflows/building-deb-tianlu.yml index 675a771..8a2fe76 100755 --- a/.github/workflows/building-deb-tianlu.yml +++ b/.github/workflows/building-deb-tianlu.yml @@ -22,6 +22,17 @@ env: BOTTLEPATH: system-bottle jobs: + call-amd64-tianlu-test: + uses: GXDE-OS/GXDE/.github/workflows/building-deb-base.yml@master + secrets: inherit + with: + display-name: call-amd64-tianlu-test + arch: amd64 + rootfs-codename: bookworm + rootfs-source: https://deb.debian.org/debian/ + gxde-codename: bixie + gxde-codename-upload: tianlu + i386-tianlu: runs-on: ubuntu-latest steps: @@ -50,7 +61,12 @@ jobs: - name: Building ${{ GITHUB.repository }} run: | - env gitPath=$(basename $GITHUB_REPOSITORY) bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off dpkg-buildpackage -b + gitPath=$(basename $GITHUB_REPOSITORY) + if [[ -f system-bottle/$gitPath/debian/control ]]; then + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off dpkg-buildpackage -b + else + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off bash build-deb.sh + fi cp $BOTTLEPATH/*.deb . -rv sudo rename 's/\.deb$/_tianlu.deb/' *.deb @@ -122,7 +138,12 @@ jobs: - name: Building ${{ GITHUB.repository }} run: | - env gitPath=$(basename $GITHUB_REPOSITORY) bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off dpkg-buildpackage -b + gitPath=$(basename $GITHUB_REPOSITORY) + if [[ -f system-bottle/$gitPath/debian/control ]]; then + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off dpkg-buildpackage -b + else + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off bash build-deb.sh + fi cp $BOTTLEPATH/*.deb . -rv sudo rename 's/\.deb$/_tianlu.deb/' *.deb @@ -195,7 +216,12 @@ jobs: - name: Building ${{ GITHUB.repository }} run: | - env gitPath=$(basename $GITHUB_REPOSITORY) bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off dpkg-buildpackage -b + gitPath=$(basename $GITHUB_REPOSITORY) + if [[ -f system-bottle/$gitPath/debian/control ]]; then + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off dpkg-buildpackage -b + else + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off bash build-deb.sh + fi cp $BOTTLEPATH/*.deb . -rv sudo rename 's/\.deb$/_tianlu.deb/' *.deb @@ -267,7 +293,12 @@ jobs: - name: Building ${{ GITHUB.repository }} run: | - env gitPath=$(basename $GITHUB_REPOSITORY) bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off dpkg-buildpackage -b + gitPath=$(basename $GITHUB_REPOSITORY) + if [[ -f system-bottle/$gitPath/debian/control ]]; then + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off dpkg-buildpackage -b + else + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off bash build-deb.sh + fi cp $BOTTLEPATH/*.deb . -rv sudo rename 's/\.deb$/_tianlu.deb/' *.deb @@ -342,7 +373,12 @@ jobs: - name: Building ${{ GITHUB.repository }} run: | - env gitPath=$(basename $GITHUB_REPOSITORY) bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off dpkg-buildpackage -b + gitPath=$(basename $GITHUB_REPOSITORY) + if [[ -f system-bottle/$gitPath/debian/control ]]; then + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off dpkg-buildpackage -b + else + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off bash build-deb.sh + fi cp $BOTTLEPATH/*.deb . -rv sudo rename 's/\.deb$/_tianlu.deb/' *.deb @@ -417,7 +453,12 @@ jobs: - name: Building ${{ GITHUB.repository }} run: | set +e - env gitPath=$(basename $GITHUB_REPOSITORY) bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off dpkg-buildpackage -b + gitPath=$(basename $GITHUB_REPOSITORY) + if [[ -f system-bottle/$gitPath/debian/control ]]; then + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off dpkg-buildpackage -b + else + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=bixie GO111MODULE=off bash build-deb.sh + fi cp $BOTTLEPATH/*.deb . -rv sudo rename 's/\.deb$/_tianlu.deb/' *.deb diff --git a/.github/workflows/building-deb-zhuangzhuang.yml b/.github/workflows/building-deb-zhuangzhuang.yml index aa84c1b..eb26663 100755 --- a/.github/workflows/building-deb-zhuangzhuang.yml +++ b/.github/workflows/building-deb-zhuangzhuang.yml @@ -50,7 +50,12 @@ jobs: - name: Building ${{ GITHUB.repository }} run: | - env gitPath=$(basename $GITHUB_REPOSITORY) bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=lizhi GO111MODULE=off dpkg-buildpackage -b + gitPath=$(basename $GITHUB_REPOSITORY) + if [[ -f system-bottle/$gitPath/debian/control ]]; then + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=lizhi GO111MODULE=off dpkg-buildpackage -b + else + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=lizhi GO111MODULE=off bash build-deb.sh + fi cp $BOTTLEPATH/*.deb . -rv sudo rename 's/\.deb$/_zhuangzhuang.deb/' *.deb @@ -123,7 +128,12 @@ jobs: - name: Building ${{ GITHUB.repository }} run: | - env gitPath=$(basename $GITHUB_REPOSITORY) bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=lizhi GO111MODULE=off dpkg-buildpackage -b + gitPath=$(basename $GITHUB_REPOSITORY) + if [[ -f system-bottle/$gitPath/debian/control ]]; then + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=lizhi GO111MODULE=off dpkg-buildpackage -b + else + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=lizhi GO111MODULE=off bash build-deb.sh + fi cp $BOTTLEPATH/*.deb . -rv sudo rename 's/\.deb$/_zhuangzhuang.deb/' *.deb @@ -196,7 +206,12 @@ jobs: - name: Building ${{ GITHUB.repository }} run: | - env gitPath=$(basename $GITHUB_REPOSITORY) bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=lizhi GO111MODULE=off dpkg-buildpackage -b + gitPath=$(basename $GITHUB_REPOSITORY) + if [[ -f system-bottle/$gitPath/debian/control ]]; then + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=lizhi GO111MODULE=off dpkg-buildpackage -b + else + env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh env GXDE_CODENAME=lizhi GO111MODULE=off bash build-deb.sh + fi cp $BOTTLEPATH/*.deb . -rv sudo rename 's/\.deb$/_zhuangzhuang.deb/' *.deb