Files
golang-1.22/.github/workflows/main.yml
odatacc 6cdcae0ed9
All checks were successful
Build and Package Golang / build (push) Successful in 5m30s
上传文件至 .github/workflows
2024-12-02 18:46:49 +08:00

74 lines
1.8 KiB
YAML

name: Build and Package Golang
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
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
run: |
export GOROOT_BOOTSTRAP=/usr/local/go
cd src
./make.bash
- name: Prepare Debian metadata
run: |
mkdir -p debian/source
echo "3.0 (native)" > debian/source/format
mkdir -p debian
cat <<EOF > debian/control
Source: template-repository
Section: devel
Priority: optional
Maintainer: Tsic404 <liuheng@deepin.org>
Standards-Version: 4.5.0
Homepage: https://go.dev
Package: golang
Architecture: amd64
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
run: |
dpkg-buildpackage -us -uc
mv ../*.deb ./ # 将生成的 .deb 文件移动到工作目录
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: golang-package
path: ./*.deb