Files
golang-1.22/.github/workflows/main.yml
odatacc 27175fcf7d
All checks were successful
Build and Package Golang / build (push) Successful in 5m20s
更新 .github/workflows/main.yml
2024-12-02 19:31:54 +08:00

66 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
- name: Download Go Bootstrap
run: |
wget https://go.dev/dl/go1.22.6.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.22.6.linux-amd64.tar.gz
mv /usr/local/go /usr/local/go-bootstrap
- name: Compile Golang from source
run: |
export GOROOT_BOOTSTRAP=/usr/local/go-bootstrap
cd src
./make.bash
cd ..
- name: Prepare .deb package structure
run: |
mkdir -p build/usr/local/go
find . -maxdepth 1 -mindepth 1 ! -name 'build' -exec 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