Skip to content

测试打包

测试打包 #13

name: Publish MediaConverters NuGet
on: [push]
jobs:
PackOnLinuxX64:
runs-on: ubuntu-latest
container:
image: debian:buster-slim
steps:
# 由于 Debian 10 (buster) 停止维护了,需要换成 archive.debian.org 源头
- name: UpdateSource
run: |
rm /etc/apt/sources.list
echo 'deb http://archive.debian.org/debian buster main contrib non-free' >> /etc/apt/sources.list
echo 'deb http://archive.debian.org/debian buster-updates main contrib non-free' >> /etc/apt/sources.list
echo 'deb http://archive.debian.org/debian-security buster/updates main contrib non-free' >> /etc/apt/sources.list
- name: InstallTool
run: |
dpkg --add-architecture arm64
apt-get clean
apt-get update
apt-get install libicu-dev -y
apt-get install libssl-dev -y
apt-get install wget -y
apt-get install curl -y
apt-get install clang llvm -y
apt-get install gcc-aarch64-linux-gnu -y
apt-get install binutils-aarch64-linux-gnu -y
apt-get install zlib1g-dev -y
apt-get install zlib1g-dev:arm64 -y
- uses: actions/checkout@v4
- name: Install dotnet tool
run: dotnet tool install -g dotnetCampus.TagToVersion
- name: Set tag to version
run: dotnet TagToVersion -t ${{ github.ref }}
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
9.0.x
- name: Build with dotnet
run: dotnet build --configuration Release src/MediaConverters/MediaConverters.sln
- name: Publish and Pack linux-x64
run: |
dotnet publish -c Release -r linux-x64 src/MediaConverters/MediaConverters.Tool/MediaConverters.Tool.csproj
dotnet pack --configuration Release /p:RuntimeIdentifier=linux-x64 src/MediaConverters/MediaConverters.Tool.RuntimeNuGet/MediaConverters.Tool.RuntimeNuGet.csproj
- uses: actions/upload-artifact@v4
name: UploadArtifact
with:
name: linux-x64
path: bin/Release/
retention-days: 1
PackOnLinuxArm64:
runs-on: ubuntu-24.04-arm
container:
image: debian:buster-slim
steps:
# 由于 Debian 10 (buster) 停止维护了,需要换成 archive.debian.org 源头
- name: UpdateSource
run: |
rm /etc/apt/sources.list
echo 'deb http://archive.debian.org/debian buster main contrib non-free' >> /etc/apt/sources.list
echo 'deb http://archive.debian.org/debian buster-updates main contrib non-free' >> /etc/apt/sources.list
echo 'deb http://archive.debian.org/debian-security buster/updates main contrib non-free' >> /etc/apt/sources.list
- name: InstallTool
run: |
dpkg --add-architecture arm64
apt-get clean
apt-get update
apt-get install libicu-dev -y
apt-get install libssl-dev -y
apt-get install wget -y
apt-get install curl -y
apt-get install clang llvm -y
apt-get install gcc-aarch64-linux-gnu -y
apt-get install binutils-aarch64-linux-gnu -y
apt-get install zlib1g-dev -y
apt-get install zlib1g-dev:arm64 -y
- uses: actions/checkout@v4
- name: Install dotnet tool
run: dotnet tool install -g dotnetCampus.TagToVersion
- name: Set tag to version
run: dotnet TagToVersion -t ${{ github.ref }}
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
9.0.x
- name: Build with dotnet
run: dotnet build --configuration Release src/MediaConverters/MediaConverters.sln
- name: Publish and Pack linux-arm64
run: |
dotnet publish -c Release -r linux-arm64 src/MediaConverters/MediaConverters.Tool/MediaConverters.Tool.csproj
dotnet pack --configuration Release /p:RuntimeIdentifier=linux-arm64 src/MediaConverters/MediaConverters.Tool.RuntimeNuGet/MediaConverters.Tool.RuntimeNuGet.csproj
- uses: actions/upload-artifact@v4
name: UploadArtifact
with:
name: linux-arm64
path: bin/Release/
retention-days: 1