Files
golang-1.22/.github/workflows/main.yml
odatacc b2a61d4f9a
Some checks failed
Build and Package Golang / build (push) Failing after 1m44s
上传文件至 .github/workflows
2024-12-02 10:32:07 +08:00

65 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 devscripts
- 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 go-src
- name: Build Golang
working-directory: go-src/src
run: |
./make.bash
- name: Create Debian package
run: |
mkdir -p golang-deb/DEBIAN
mkdir -p golang-deb/usr/local/go
# Copy the compiled binaries
cp -r go-src/* golang-deb/usr/local/go/
# Create control file
cat <<EOF > golang-deb/DEBIAN/control
Package: golang
Version: 1.22.6
Section: devel
Priority: optional
Architecture: amd64
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.
EOF
- name: Build .deb package
run: |
dpkg-deb --build golang-deb
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: golang-package
path: golang-deb.deb