mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-19 02:08:59 +08:00
fix(debian): 移除对 ARM 架构的支持,简化 DEB 包构建流程
This commit is contained in:
parent
7d190fcbc1
commit
1cf40ae473
38
.github/workflows/pkg-deb.yml
vendored
38
.github/workflows/pkg-deb.yml
vendored
@ -15,9 +15,6 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-deb:
|
build-deb:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
arch: [amd64, arm64]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@ -43,13 +40,6 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Set up cross-compilation for ARM architectures
|
|
||||||
if: matrix.arch != 'amd64'
|
|
||||||
run: |
|
|
||||||
sudo dpkg --add-architecture ${{ matrix.arch }}
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y gcc-aarch64-linux-gnu crossbuild-essential-${{ matrix.arch }}
|
|
||||||
|
|
||||||
- name: Update debian/changelog with version
|
- name: Update debian/changelog with version
|
||||||
run: |
|
run: |
|
||||||
version="${{ steps.get_version.outputs.version }}"
|
version="${{ steps.get_version.outputs.version }}"
|
||||||
@ -68,23 +58,12 @@ jobs:
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y debhelper devscripts build-essential fakeroot
|
sudo apt-get install -y debhelper devscripts build-essential fakeroot
|
||||||
|
|
||||||
- name: Configure cross-compilation
|
|
||||||
if: matrix.arch == 'arm64'
|
|
||||||
run: |
|
|
||||||
echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
|
|
||||||
echo "DEB_BUILD_OPTIONS=nocheck" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build DEB package
|
- name: Build DEB package
|
||||||
run: |
|
run: |
|
||||||
version="${{ steps.get_version.outputs.version }}"
|
version="${{ steps.get_version.outputs.version }}"
|
||||||
|
|
||||||
# Build the package
|
# Build the package
|
||||||
if [ "${{ matrix.arch }}" = "amd64" ]; then
|
|
||||||
debuild -us -uc -b
|
debuild -us -uc -b
|
||||||
else
|
|
||||||
# For cross-compilation, we need to use dpkg-buildpackage directly
|
|
||||||
DEB_BUILD_OPTIONS="nocheck" dpkg-buildpackage -us -uc -b -a${{ matrix.arch }}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Move the generated .deb file to a known location
|
# Move the generated .deb file to a known location
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
@ -94,7 +73,7 @@ jobs:
|
|||||||
cd dist
|
cd dist
|
||||||
for file in chsrc_${version}*.deb; do
|
for file in chsrc_${version}*.deb; do
|
||||||
if [ -f "$file" ]; then
|
if [ -f "$file" ]; then
|
||||||
new_name="chsrc_${version}-1_${{ matrix.arch }}.deb"
|
new_name="chsrc_${version}-1_amd64.deb"
|
||||||
if [ "$file" != "$new_name" ]; then
|
if [ "$file" != "$new_name" ]; then
|
||||||
mv "$file" "$new_name"
|
mv "$file" "$new_name"
|
||||||
fi
|
fi
|
||||||
@ -106,15 +85,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
version="${{ steps.get_version.outputs.version }}"
|
version="${{ steps.get_version.outputs.version }}"
|
||||||
ls -la dist/
|
ls -la dist/
|
||||||
dpkg-deb --info dist/chsrc_${version}-1_${{ matrix.arch }}.deb
|
dpkg-deb --info dist/chsrc_${version}-1_amd64.deb
|
||||||
dpkg-deb --contents dist/chsrc_${version}-1_${{ matrix.arch }}.deb
|
dpkg-deb --contents dist/chsrc_${version}-1_amd64.deb
|
||||||
|
|
||||||
- name: Test package installation (amd64 only)
|
- name: Test package installation
|
||||||
if: matrix.arch == 'amd64'
|
|
||||||
run: |
|
run: |
|
||||||
version="${{ steps.get_version.outputs.version }}"
|
version="${{ steps.get_version.outputs.version }}"
|
||||||
# Install the package
|
# Install the package
|
||||||
sudo dpkg -i dist/chsrc_${version}-1_${{ matrix.arch }}.deb || true
|
sudo dpkg -i dist/chsrc_${version}-1_amd64.deb || true
|
||||||
sudo apt-get install -f -y || true
|
sudo apt-get install -f -y || true
|
||||||
|
|
||||||
# Run basic tests
|
# Run basic tests
|
||||||
@ -129,7 +107,7 @@ jobs:
|
|||||||
- name: Upload DEB artifact
|
- name: Upload DEB artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: chsrc-deb-${{ matrix.arch }}
|
name: chsrc-deb-amd64
|
||||||
path: dist/chsrc_*.deb
|
path: dist/chsrc_*.deb
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
@ -140,8 +118,8 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ github.event.release.upload_url }}
|
upload_url: ${{ github.event.release.upload_url }}
|
||||||
asset_path: dist/chsrc_${{ steps.get_version.outputs.version }}-1_${{ matrix.arch }}.deb
|
asset_path: dist/chsrc_${{ steps.get_version.outputs.version }}-1_amd64.deb
|
||||||
asset_name: chsrc_${{ steps.get_version.outputs.version }}-1_${{ matrix.arch }}.deb
|
asset_name: chsrc_${{ steps.get_version.outputs.version }}-1_amd64.deb
|
||||||
asset_content_type: application/vnd.debian.binary-package
|
asset_content_type: application/vnd.debian.binary-package
|
||||||
|
|
||||||
create-repository-metadata:
|
create-repository-metadata:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user