Skip to content

rom_Transplant

rom_Transplant #30

name: rom_Transplant
on:
workflow_dispatch:
inputs:
URL:
description: "待移植的系统包下载地址"
required: true
OS_version:
description: "待打包的OS版本号(可为空)"
Bottom_URL:
description: "底包下载地址"
required: true
IMAGE_TYPE:
description: "IMG格式,可选erofs、ext"
required: true
default: 'erofs'
type: choice
options:
- erofs
- ext
EXT4_RW:
description: '读写'
required: true
type: boolean
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 最大化构建环境
uses: easimon/maximize-build-space@master
with:
swap-size-mb: 8192
root-reserve-mb: 4096
temp-reserve-mb: 4096
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
- name: 检出仓库文件
uses: actions/checkout@main
- name: -准备环境
run: |
sudo timedatectl set-timezone Asia/Shanghai
if [ -n "${{ github.event.inputs.OS_version }}" ]; then
echo "OS_version=${{ github.event.inputs.OS_version }}" >> $GITHUB_ENV
else
echo "OS_version=$(echo "${{ github.event.inputs.URL }}" | cut -d'_' -f3)" >> $GITHUB_ENV
fi
echo "EXT4_RW=${{ github.event.inputs.EXT4_RW }}" >> $GITHUB_ENV
echo "IMAGE_TYPE=${{ github.event.inputs.IMAGE_TYPE }}" >> $GITHUB_ENV
echo "URL=${{ github.event.inputs.URL }}" >> $GITHUB_ENV
echo "Bottom_URL=${{ github.event.inputs.Bottom_URL }}" >> $GITHUB_ENV
sudo apt install python3 python3-pip aria2 zip p7zip-full tar zstd dos2unix
sudo apt --fix-broken install
sudo apt update --fix-missing
pip3 install --upgrade pip
pip3 install pycryptodome
pip3 install setuptools
pip3 install docopt
pip3 install requests
pip3 install beautifulsoup4
pip3 install --ignore-installed pyyaml
- name: -制作rom‌‌
run: |
sudo bash "$GITHUB_WORKSPACE"/make.sh ${URL} ${OS_version} ${GITHUB_WORKSPACE} $GITHUB_ENV ${Bottom_URL} ${IMAGE_TYPE} ${EXT4_RW}
- name: -处理包
run: |
mkdir -p "$GITHUB_WORKSPACE"/GithubRelease
cd "$GITHUB_WORKSPACE"/GithubRelease
sudo split -b 1536M -d "$GITHUB_WORKSPACE"/zip/"${{ env.NEW_PACKAGE_NAME }}" "${{ env.NEW_PACKAGE_NAME }}"
- name: -上传到Github Release
uses: ncipollo/release-action@main
with:
artifacts: "${{ github.workspace }}/GithubRelease/*"
name: "${{ env.OS_version }}"
tag: "${{ env.OS_version }}"
bodyFile: "${{ github.workspace }}/file.log"
allowUpdates: true
artifactErrorsFailBuild: true
token: ${{ secrets.GITHUB_TOKEN }}