Skip to content

v1.14.517

v1.14.517 #52

Workflow file for this run

name: deb-build
on:
push:
tags: [ "v*" ]
jobs:
package:
runs-on: arm64
strategy:
matrix:
target:
[
"arm64v8/ubuntu:20.04",
"arm64v8/ubuntu:22.04",
"arm64v8/ubuntu:24.04",
"arm64v8/debian:11",
"arm64v8/debian:12",
"arm64v8/debian:trixie",
"linuxdeepin/deepin:beige-arm64-v1.4.0",
"chenchongbiao/openkylin:nile-arm64",
]
container:
image: "${{ matrix.target }}"
steps:
- name: Install Dependencies
shell: bash
env:
TARGET_DISTRO: "${{ matrix.target }}"
run: |
echo "${TARGET_DISTRO}"
if [[ "${TARGET_DISTRO}" = "linuxdeepin/deepin:beige-arm64-v1.4.0" ]]; then
sed -e 's|https://community-packages.deepin.com|https://mirrors.bfsu.edu.cn/deepin|g' -i /etc/apt/sources.list;
fi
apt-get update
env DEBIAN_FRONTEND=noninteractive apt-get install -y curl
if [[ "${TARGET_DISTRO}" != "chenchongbiao/openkylin:nile-arm64" ]]; then
curl -fsSL https://deb.nodesource.com/setup_22.x | bash;
fi
env DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential zlib1g-dev libssl-dev pkgconf nettle-dev libapt-pkg-dev curl xz-utils clang openssh-client rsync nodejs libbz2-dev liblzma-dev
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
cache: false
- uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.target }}"
- name: Install cargo-deb
run: cargo install -f cargo-deb
- name: Build deb package
shell: bash
run: |
cargo deb -Z xz
VER_SUFFIX="${TARGET_DISTRO/:/}"
VER_SUFFIX="${VER_SUFFIX##*\/}"
case "${TARGET_DISTRO}" in
'arm64v8/debian:11')
CODENAME='bullseye'
;;
'arm64v8/debian:12')
CODENAME='bookworm'
;;
'arm64v8/debian:trixie')
CODENAME='trixie'
VER_SUFFIX='debian13'
;;
'arm64v8/ubuntu:20.04')
CODENAME='focal'
;;
'arm64v8/ubuntu:22.04')
CODENAME='jammy'
;;
'arm64v8/ubuntu:24.04')
CODENAME='noble'
;;
'linuxdeepin/deepin:beige-arm64-v1.4.0')
CODENAME='beige'
VER_SUFFIX="deepin23"
;;
'chenchongbiao/openkylin:nile-arm64')
CODENAME='nile'
VER_SUFFIX="openkylin2.0"
;;
esac
for i in target/debian/*.deb; do
mv -v "${i}" "${i/\.deb/-$VER_SUFFIX.deb}"
done
echo "VER_SUFFIX=${VER_SUFFIX}" >> "${GITHUB_ENV}"
echo "CODENAME=${CODENAME}" >> "${GITHUB_ENV}"
env:
TARGET_DISTRO: "${{ matrix.target }}"
- name: Setup SSH private key
env:
KEY: ${{ secrets.KEY }}
run: |
mkdir -p ~/.ssh/
chmod 0700 ~/.ssh/
echo "$KEY" > ~/.ssh/id_ed25519
cp .github/workflows/known_hosts ~/.ssh/known_hosts
chmod 0600 ~/.ssh/id_ed25519 ~/.ssh/known_hosts
- name: Upload packages (repository)
shell: bash
run: |
rsync \
--ignore-existing \
-v \
-e "ssh \
-o IdentityFile=$HOME/.ssh/id_ed25519 \
-o UserKnownHostsFile=$HOME/.ssh/known_hosts" \
target/debian/*-"${VER_SUFFIX}".deb \
${USER}@repo.aosc.io:/mirror/oma/pool/"${CODENAME}"/main/o/
ssh \
-v \
-o IdentityFile=~/.ssh/id_ed25519 \
-o UserKnownHostsFile=~/.ssh/known_hosts \
${USER}@repo.aosc.io \
touch /mirror/.updated
env:
TARGET_DISTRO: "${{ matrix.target }}"
USER: ${{ secrets.USER }}
- name: Upload packages (GitHub Release)
uses: actions/upload-artifact@v4
with:
name: ${{ env.VER_SUFFIX }}
path: "target/debian/*.deb"
# Release stage
release:
runs-on: ubuntu-latest
needs: package
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- uses: actions/download-artifact@v4
- name: Upload artifacts
uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["./**/*.tar.*","./**/*.deb"]'