mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-30 13:13:24 +08:00
feat: enhance action triggers, add pack-nightly action.
This commit is contained in:
7
.github/workflows/deploy.yml
vendored
7
.github/workflows/deploy.yml
vendored
@@ -4,10 +4,7 @@ env:
|
|||||||
PROJECT_PATH: demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
|
PROJECT_PATH: demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
|
||||||
OUTPUT_PATH: demo/Semi.Avalonia.Demo.Web/bin/Release/net8.0-browser/publish/wwwroot
|
OUTPUT_PATH: demo/Semi.Avalonia.Demo.Web/bin/Release/net8.0-browser/publish/wwwroot
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
branches: [ "action/deploy" ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ "action/deploy" ]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-to-github-pages:
|
deploy-to-github-pages:
|
||||||
@@ -28,7 +25,7 @@ jobs:
|
|||||||
run: dotnet publish $PROJECT_PATH -c Release --nologo
|
run: dotnet publish $PROJECT_PATH -c Release --nologo
|
||||||
|
|
||||||
- name: Change base-tag in index.html
|
- name: Change base-tag in index.html
|
||||||
run: sed -i 's/<base href="\/" \/>/<base href="\/Semi.Avalonia\/" \/>/g' $OUTPUT_PATH/index.html
|
run: sed -i 's#<base href="/" />#<base href="/Semi.Avalonia/" />#g' $OUTPUT_PATH/index.html
|
||||||
|
|
||||||
- name: copy index.html to 404.html
|
- name: copy index.html to 404.html
|
||||||
run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html
|
run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html
|
||||||
|
|||||||
68
.github/workflows/pack-nightly.yml
vendored
Normal file
68
.github/workflows/pack-nightly.yml
vendored
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
name: Pack Nightly
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
Semi_Avalonia:
|
||||||
|
description: 'Pack Semi.Avalonia'
|
||||||
|
required: true
|
||||||
|
default: 'true'
|
||||||
|
type: boolean
|
||||||
|
Semi_Avalonia_ColorPicker:
|
||||||
|
description: 'Pack Semi.Avalonia.ColorPicker'
|
||||||
|
required: true
|
||||||
|
default: 'true'
|
||||||
|
type: boolean
|
||||||
|
Semi_Avalonia_DataGrid:
|
||||||
|
description: 'Pack Semi.Avalonia.DataGrid'
|
||||||
|
required: true
|
||||||
|
default: 'true'
|
||||||
|
type: boolean
|
||||||
|
Semi_Avalonia_TreeDataGrid:
|
||||||
|
description: 'Pack Semi.Avalonia.TreeDataGrid'
|
||||||
|
required: true
|
||||||
|
default: 'false'
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Pack_Nightly:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
|
- name: Get Version
|
||||||
|
run: |
|
||||||
|
VERSION_TIMESTAMP=$(date +'%Y%m%d%H%M%S')
|
||||||
|
VERSION="${{ vars.VERSION_NIGHTLY_PREFIX }}-nightly-${VERSION_TIMESTAMP}"
|
||||||
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Pack Semi.Avalonia
|
||||||
|
if: ${{ github.event.inputs.Semi_Avalonia == 'true' }}
|
||||||
|
run: dotnet pack ./src/Semi.Avalonia -o ./nugets /p:Version=${{ env.VERSION }}
|
||||||
|
|
||||||
|
- name: Pack Semi.Avalonia.ColorPicker
|
||||||
|
if: ${{ github.event.inputs.Semi_Avalonia_ColorPicker == 'true' }}
|
||||||
|
run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets /p:Version=${{ env.VERSION }}
|
||||||
|
|
||||||
|
- name: Pack Semi.Avalonia.DataGrid
|
||||||
|
if: ${{ github.event.inputs.Semi_Avalonia_DataGrid == 'true' }}
|
||||||
|
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets /p:Version=${{ env.VERSION }}
|
||||||
|
|
||||||
|
- name: Pack Semi.Avalonia.TreeDataGrid
|
||||||
|
if: ${{ github.event.inputs.Semi_Avalonia_TreeDataGrid == 'true' }}
|
||||||
|
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets /p:Version=${{ env.VERSION }}
|
||||||
|
|
||||||
|
- name: Add NuGet Source
|
||||||
|
run: dotnet nuget add source ${{ secrets.IRIHI_NUGET_FEED }} -n irihi.tech -u ${{ secrets.IRIHI_NUGET_USERNAME }} -p ${{ secrets.IRIHI_NUGET_PASSWORD }} --store-password-in-clear-text
|
||||||
|
|
||||||
|
- name: Publish Nightly Package
|
||||||
|
run: dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.IRIHI_NUGET_API_KEY }} --source irihi.tech --skip-duplicate
|
||||||
|
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v4.3.1
|
||||||
|
with:
|
||||||
|
name: nugets
|
||||||
|
path: ./nugets
|
||||||
|
if: always()
|
||||||
26
.github/workflows/pack-tree.yml
vendored
26
.github/workflows/pack-tree.yml
vendored
@@ -1,26 +0,0 @@
|
|||||||
name: Pack TreeDataGrid Nuget
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "action/pack-tree" ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ "action/pack-tree" ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
nuget:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4.1.1
|
|
||||||
|
|
||||||
- name: Nuget Semi.Avalonia.TreeDataGrid
|
|
||||||
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
|
|
||||||
|
|
||||||
- name: Publish NuGet package
|
|
||||||
run: dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
|
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
|
||||||
uses: actions/upload-artifact@v4.3.1
|
|
||||||
with:
|
|
||||||
name: nugets
|
|
||||||
path: ./nugets
|
|
||||||
49
.github/workflows/pack.yml
vendored
49
.github/workflows/pack.yml
vendored
@@ -1,26 +1,52 @@
|
|||||||
name: Pack Nuget
|
name: Pack to NuGet
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
branches: [ "action/pack" ]
|
inputs:
|
||||||
pull_request:
|
Semi_Avalonia:
|
||||||
branches: [ "action/pack" ]
|
description: 'Pack Semi.Avalonia'
|
||||||
|
required: true
|
||||||
|
default: 'true'
|
||||||
|
type: boolean
|
||||||
|
Semi_Avalonia_ColorPicker:
|
||||||
|
description: 'Pack Semi.Avalonia.ColorPicker'
|
||||||
|
required: true
|
||||||
|
default: 'true'
|
||||||
|
type: boolean
|
||||||
|
Semi_Avalonia_DataGrid:
|
||||||
|
description: 'Pack Semi.Avalonia.DataGrid'
|
||||||
|
required: true
|
||||||
|
default: 'true'
|
||||||
|
type: boolean
|
||||||
|
Semi_Avalonia_TreeDataGrid:
|
||||||
|
description: 'Pack Semi.Avalonia.TreeDataGrid'
|
||||||
|
required: true
|
||||||
|
default: 'false'
|
||||||
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
nuget:
|
Pack_to_NuGet:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
- name: Nuget Semi.Avalonia
|
- name: Pack Semi.Avalonia
|
||||||
|
if: ${{ github.event.inputs.Semi_Avalonia == 'true' }}
|
||||||
run: dotnet pack ./src/Semi.Avalonia -o ./nugets
|
run: dotnet pack ./src/Semi.Avalonia -o ./nugets
|
||||||
|
|
||||||
- name: Nuget Semi.Avalonia.ColorPicker
|
- name: Pack Semi.Avalonia.ColorPicker
|
||||||
run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets
|
if: ${{ github.event.inputs.Semi_Avalonia_ColorPicker == 'true' }}
|
||||||
|
run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets
|
||||||
|
|
||||||
- name: Nuget Semi.Avalonia.DataGrid
|
- name: Pack Semi.Avalonia.DataGrid
|
||||||
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets
|
if: ${{ github.event.inputs.Semi_Avalonia_DataGrid == 'true' }}
|
||||||
|
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets
|
||||||
|
|
||||||
|
- name: Pack Semi.Avalonia.TreeDataGrid
|
||||||
|
if: ${{ github.event.inputs.Semi_Avalonia_TreeDataGrid == 'true' }}
|
||||||
|
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
|
||||||
|
|
||||||
- name: Publish NuGet package
|
- name: Publish NuGet package
|
||||||
run: dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
|
run: dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
|
||||||
@@ -30,3 +56,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: nugets
|
name: nugets
|
||||||
path: ./nugets
|
path: ./nugets
|
||||||
|
if: always()
|
||||||
34
.github/workflows/publish.yml
vendored
34
.github/workflows/publish.yml
vendored
@@ -1,13 +1,32 @@
|
|||||||
name: Publish Demo
|
name: Publish Demo
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
branches: [ "action/publish" ]
|
inputs:
|
||||||
pull_request:
|
platform:
|
||||||
branches: [ "action/publish" ]
|
description: 'Platform to publish'
|
||||||
|
required: true
|
||||||
|
default: 'all'
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- 'windows'
|
||||||
|
- 'linux'
|
||||||
|
- 'android'
|
||||||
|
- 'all'
|
||||||
|
include_aot:
|
||||||
|
description: 'Include Windows AOT packaging'
|
||||||
|
required: true
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
|
include_drm:
|
||||||
|
description: 'Include Linux DRM packaging'
|
||||||
|
required: true
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
windows:
|
windows:
|
||||||
|
if: ${{ github.event.inputs.platform == 'windows' || github.event.inputs.platform == 'all' }}
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -25,14 +44,17 @@ jobs:
|
|||||||
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.zip
|
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.zip
|
||||||
|
|
||||||
- name: Enable Native AOT in .csproj
|
- name: Enable Native AOT in .csproj
|
||||||
|
if: ${{ github.event.inputs.include_aot == true }}
|
||||||
run: |
|
run: |
|
||||||
sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||||
sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||||
|
|
||||||
- name: Publish win-x64 AOT
|
- name: Publish win-x64 AOT
|
||||||
|
if: ${{ github.event.inputs.include_aot == true }}
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
|
||||||
|
|
||||||
- name: Zip win-x64 AOT
|
- name: Zip win-x64 AOT
|
||||||
|
if: ${{ github.event.inputs.include_aot == true }}
|
||||||
run: |
|
run: |
|
||||||
$files = Get-ChildItem -Path ./publish/win64-aot/* -Recurse -Exclude *.pdb
|
$files = Get-ChildItem -Path ./publish/win64-aot/* -Recurse -Exclude *.pdb
|
||||||
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip
|
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip
|
||||||
@@ -44,6 +66,7 @@ jobs:
|
|||||||
path: ./upload
|
path: ./upload
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
|
if: ${{ github.event.inputs.platform == 'linux' || github.event.inputs.platform == 'all' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -59,9 +82,11 @@ jobs:
|
|||||||
run: zip -j -r ./upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
|
run: zip -j -r ./upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
|
||||||
|
|
||||||
- name: Publish linux-x64 DRM
|
- name: Publish linux-x64 DRM
|
||||||
|
if: ${{ github.event.inputs.include_drm == true }}
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/drm
|
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/drm
|
||||||
|
|
||||||
- name: Zip linux-x64 DRM
|
- name: Zip linux-x64 DRM
|
||||||
|
if: ${{ github.event.inputs.include_drm == true }}
|
||||||
run: zip -j -r ./upload/Semi.Avalonia.Demo.Drm.linux-x64.zip ./publish/drm -x "*.pdb"
|
run: zip -j -r ./upload/Semi.Avalonia.Demo.Drm.linux-x64.zip ./publish/drm -x "*.pdb"
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
@@ -71,6 +96,7 @@ jobs:
|
|||||||
path: ./upload
|
path: ./upload
|
||||||
|
|
||||||
android:
|
android:
|
||||||
|
if: ${{ github.event.inputs.platform == 'android' || github.event.inputs.platform == 'all' }}
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Action", "GitHub Act
|
|||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
.github\workflows\deploy.yml = .github\workflows\deploy.yml
|
.github\workflows\deploy.yml = .github\workflows\deploy.yml
|
||||||
.github\workflows\pack.yml = .github\workflows\pack.yml
|
.github\workflows\pack.yml = .github\workflows\pack.yml
|
||||||
.github\workflows\pack-tree.yml = .github\workflows\pack-tree.yml
|
.github\workflows\pack-nightly.yml = .github\workflows\pack-nightly.yml
|
||||||
.github\workflows\publish.yml = .github\workflows\publish.yml
|
.github\workflows\publish.yml = .github\workflows\publish.yml
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
|
|||||||
Reference in New Issue
Block a user