Skip to content

feat: Optimize aspect‐ratio locking in batch conversion #130

feat: Optimize aspect‐ratio locking in batch conversion

feat: Optimize aspect‐ratio locking in batch conversion #130

Workflow file for this run

name: Build and Release
on:
push:
branches: [ "master" ]
tags:
- 'v*.*.*'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
runtime: linux-x64
archive_name: LottieViewConvert.Linux.X64.zip
- os: ubuntu-latest
runtime: linux-arm64
archive_name: LottieViewConvert.Linux.Arm64.zip
- os: macos-latest
runtime: osx-x64
archive_name: LottieViewConvert.MacOS.X64.zip
- os: macos-latest
runtime: osx-arm64
archive_name: LottieViewConvert.MacOS.Arm64.zip
- os: windows-latest
runtime: win-x64
archive_name: LottieViewConvert.Win.X64.zip
name: Build on ${{ matrix.os }} (${{ matrix.runtime }})
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
include-prerelease: true
- name: Restore dependencies
run: dotnet restore
- name: Publish LottieViewConvert for ${{ matrix.runtime }}
shell: bash
run: |
dotnet publish ./LottieViewConvert/LottieViewConvert.csproj \
-c Release \
-f net8.0 \
-r ${{ matrix.runtime }} \
--self-contained true \
-p:UseAppHost=true \
-p:PublishReadyToRun=true \
-p:PublishSingleFile=true \
-o ./publish/${{ matrix.runtime }}
- name: Create archive for ${{ matrix.runtime }}
shell: bash
run: |
cd publish/${{ matrix.runtime }}
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
powershell -Command "Compress-Archive -Path * -DestinationPath ../../${{ matrix.archive_name }}"
else
zip -r ../../${{ matrix.archive_name }} *
fi
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.archive_name }}
path: ${{ matrix.archive_name }}
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Prepare release files
run: |
mkdir -p ./release-files
find ./artifacts -name "*.zip" -exec cp {} ./release-files/ \;
echo "Files prepared for release:"
ls -la ./release-files/
- name: Create Release using GitHub CLI
run: |
# Create the release
gh release create ${{ github.ref_name }} \
--title "Release ${{ github.ref_name }}" \
--notes "Release ${{ github.ref_name }}" \
--draft=false \
--prerelease=false
# Upload each file individually
for file in ./release-files/*.zip; do
echo "Uploading $file"
gh release upload ${{ github.ref_name }} "$file"
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}