mirror of
https://github.com/GXDE-OS/GXDE.git
synced 2026-06-22 07:06:38 +08:00
6e00091e9c
Signed-off-by: gfdgd_xi <3025613752@qq.com>
151 lines
4.6 KiB
YAML
Executable File
151 lines
4.6 KiB
YAML
Executable File
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
|
|
|
|
gxde-is-backport:
|
|
type: boolean
|
|
description: 'Is build with backport'
|
|
required: false
|
|
|
|
gxde-cross-arch:
|
|
type: string
|
|
description: 'Build deb to which arch'
|
|
required: false
|
|
|
|
display-name:
|
|
required: false
|
|
type: string
|
|
|
|
|
|
|
|
env:
|
|
REPOSITORY: https://github.com/GXDE-OS/GXDE
|
|
BOTTLEPATH: system-bottle
|
|
|
|
jobs:
|
|
build:
|
|
if: github.repository_owner == 'GXDE-OS'
|
|
name: ${{ inputs.display-name || 'Build Job' }}
|
|
runs-on: riscv-builders
|
|
steps:
|
|
- 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: |
|
|
if [[ ${{ inputs.gxde-is-backport }} == true ]]; then
|
|
isBackport=backport
|
|
fi
|
|
export REPO_BRANCH=${{ github.ref_name }}
|
|
bash .github/workflows/configure-building-enviroment-base-system.sh ${{ inputs.arch }} \
|
|
${{ inputs.rootfs-codename }} \
|
|
$REPOSITORY \
|
|
https://github.com/$GITHUB_REPOSITORY \
|
|
${{ inputs.rootfs-source }} \
|
|
${{ github.ref_name }} \
|
|
$isBackport
|
|
|
|
- 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_ARCH=${{ inputs.arch }} GXDE_CODENAME=${{ inputs.gxde-codename }} \
|
|
GXDE_ARCH=${{ inputs.arch }} GXDE_CROSS_ARCH=${{ inputs.gxde-cross-arch }} GO111MODULE=off \
|
|
dpkg-buildpackage -b
|
|
else
|
|
env gitPath=$gitPath bash .github/workflows/run-command-in-chroot.sh \
|
|
env GXDE_ARCH=${{ inputs.arch }} GXDE_CODENAME=${{ inputs.gxde-codename }} \
|
|
GXDE_ARCH=${{ inputs.arch }} GXDE_CROSS_ARCH=${{ inputs.gxde-cross-arch }} 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
|
|
echo -e "ls -1 | grep dbg_ | 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
|