上传文件至 .github/workflows
Some checks failed
Build and Package Golang / build (push) Failing after 1m40s

This commit is contained in:
2024-12-02 19:14:38 +08:00
parent 6cdcae0ed9
commit 7a41aacf69

View File

@ -20,54 +20,41 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y debhelper dh-golang build-essential wget
wget https://go.dev/dl/go1.22.6.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.22.6.linux-amd64.tar.gz
- name: Build Golang
- name: Compile Golang from source
run: |
export GOROOT_BOOTSTRAP=/usr/local/go
export GOROOT_BOOTSTRAP=$(pwd)/go-bootstrap # 临时 GOROOT
mkdir -p $GOROOT_BOOTSTRAP
cd src
./make.bash
./make.bash
cd ..
- name: Prepare Debian metadata
- name: Prepare .deb package structure
run: |
mkdir -p debian/source
echo "3.0 (native)" > debian/source/format
mkdir -p debian
cat <<EOF > debian/control
Source: template-repository
mkdir -p build/usr/local/go
cp -r ./* build/usr/local/go/
# 创建 DEBIAN 目录并写入控制信息
mkdir -p build/DEBIAN
cat <<EOF > build/DEBIAN/control
Package: golang
Version: 1.22.6-1
Section: devel
Priority: optional
Maintainer: Tsic404 <liuheng@deepin.org>
Standards-Version: 4.5.0
Homepage: https://go.dev
Package: golang
Architecture: amd64
Maintainer: Deepin Community <community@deepin.org>
Depends: libc6 (>= 2.17)
Description: The Go programming language
Go is an open source programming language that makes it easy
to build simple, reliable, and efficient software.
EOF
cat <<EOF > debian/rules
#!/usr/bin/make -f
%:
dh \$@
EOF
chmod +x debian/rules
echo "9" > debian/compat
- name: Package into .deb
- name: Build .deb package
run: |
dpkg-buildpackage -us -uc
mv ../*.deb ./ # 将生成的 .deb 文件移动到工作目录
dpkg-deb --build build golang_1.22.6-1_amd64.deb
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: golang-package
path: ./*.deb
path: golang_1.22.6-1_amd64.deb