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

This commit is contained in:
2024-12-02 10:32:07 +08:00
parent 36b67688d4
commit b2a61d4f9a

View File

@ -19,58 +19,46 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y debhelper dh-golang build-essential wget lintian
sudo apt-get install -y debhelper dh-golang build-essential wget devscripts
- name: Download Golang source
- name: Download and extract Golang source
run: |
wget https://go.dev/dl/go1.22.6.src.tar.gz
tar -xzf go1.22.6.src.tar.gz
mv go /usr/local/go-src
mv go go-src
- name: Build Golang
working-directory: /usr/local/go-src/src
working-directory: go-src/src
run: |
./make.bash
- name: Set up environment
- name: Create Debian package
run: |
echo 'export PATH=/usr/local/go/bin:$PATH' >> $GITHUB_ENV
echo 'export PATH=/usr/local/go-src/bin:$PATH' >> $GITHUB_ENV
mkdir -p golang-deb/DEBIAN
mkdir -p golang-deb/usr/local/go
- name: Create Debian package structure
run: |
mkdir -p build
cd build
dh_make -s -y -n --createorig -p golang_1.22.6
# Copy the compiled binaries
cp -r go-src/* golang-deb/usr/local/go/
- name: Customize Debian package files
run: |
cd build/debian
# Replace control file with your configurations
cat > control <<EOL
Source: golang
# Create control file
cat <<EOF > golang-deb/DEBIAN/control
Package: golang
Version: 1.22.6
Section: devel
Priority: optional
Maintainer: Your Name <your.email@example.com>
Build-Depends: debhelper (>= 9), dh-golang, build-essential
Standards-Version: 4.5.0
Homepage: https://golang.org
Package: golang
Architecture: amd64
Depends: libc6 (>= 2.15)
Maintainer: Your Name <your.email@example.com>
Description: The Go programming language
Golang is an open source programming language that makes it easy
to build simple, reliable, and efficient software.
EOL
EOF
- name: Build Debian package
working-directory: build
- name: Build .deb package
run: |
dpkg-buildpackage -us -uc
dpkg-deb --build golang-deb
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: golang-package
path: build/../*.deb
path: golang-deb.deb