Files
golang-1.22/.github/workflows/main.yml
odatacc 7a41aacf69
Some checks failed
Build and Package Golang / build (push) Failing after 1m40s
上传文件至 .github/workflows
2024-12-02 19:14:38 +08:00

61 lines
1.6 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
- name: Compile Golang from source
run: |
export GOROOT_BOOTSTRAP=$(pwd)/go-bootstrap # 临时 GOROOT
mkdir -p $GOROOT_BOOTSTRAP
cd src
./make.bash
cd ..
- name: Prepare .deb package structure
run: |
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
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
- name: Build .deb package
run: |
dpkg-deb --build build golang_1.22.6-1_amd64.deb
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: golang-package
path: golang_1.22.6-1_amd64.deb