Skip to content

Commit 8ba8e1f

Browse files
authored
Merge pull request #687 from irihitech/workflow
Simplify actions
2 parents 3219043 + 7b99270 commit 8ba8e1f

File tree

7 files changed

+68
-54
lines changed

7 files changed

+68
-54
lines changed

.github/workflows/deploy.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ jobs:
2424
- name: Publish .NET Project
2525
run: dotnet publish $PROJECT_PATH -c Release --nologo
2626

27-
- name: Change base-tag in index.html
28-
run: sed -i 's#<base href="/" />#<base href="/Ursa.Avalonia/" />#g' $OUTPUT_PATH/index.html
29-
3027
- name: copy index.html to 404.html
3128
run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html
3229

.github/workflows/pack-nightly.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,29 @@ jobs:
4545
4646
- name: Pack Ursa
4747
if: ${{ github.event.inputs.Ursa == 'true' }}
48-
run: dotnet pack ./src/Ursa -o ./nugets /p:Version=${{ env.VERSION }}
48+
run: dotnet pack src/Ursa -o nugets /p:Version=${{ env.VERSION }}
4949

5050
- name: Pack Ursa.Themes.Semi
5151
if: ${{ github.event.inputs.Ursa_Themes_Semi == 'true' }}
52-
run: dotnet pack ./src/Ursa.Themes.Semi -o ./nugets /p:Version=${{ env.VERSION }}
52+
run: dotnet pack src/Ursa.Themes.Semi -o nugets /p:Version=${{ env.VERSION }}
5353

5454
- name: Pack Prism Extension
5555
if: ${{ github.event.inputs.PrismExtension == 'true' }}
56-
run: dotnet pack ./src/Ursa.PrismExtension -o ./nugets /p:Version=${{ env.VERSION }}
56+
run: dotnet pack src/Ursa.PrismExtension -o nugets /p:Version=${{ env.VERSION }}
5757

5858
- name: Pack ReactiveUI Extension
5959
if: ${{ github.event.inputs.ReactiveUIExtension == 'true' }}
60-
run: dotnet pack ./src/Ursa.ReactiveUIExtension -o ./nugets /p:Version=${{ env.VERSION }}
60+
run: dotnet pack src/Ursa.ReactiveUIExtension -o nugets /p:Version=${{ env.VERSION }}
6161

6262
- name: Add NuGet Source
6363
run: dotnet nuget add source ${{ secrets.IRIHI_NUGET_NIGHTLY_FEED }} -n irihi.tech -u ${{ secrets.IRIHI_NUGET_USERNAME }} -p ${{ secrets.IRIHI_NUGET_PASSWORD }} --store-password-in-clear-text
6464

6565
- name: Publish Nightly Package
66-
run: dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.IRIHI_NUGET_API_KEY }} --source irihi.tech --skip-duplicate
66+
run: dotnet nuget push "nugets/*.nupkg" --api-key ${{ secrets.IRIHI_NUGET_API_KEY }} --source irihi.tech --skip-duplicate
6767

6868
- name: Upload a Build Artifact
6969
uses: actions/upload-artifact@v4.3.1
7070
with:
7171
name: nugets
72-
path: ./nugets
72+
path: nugets
7373
if: always()

.github/workflows/pack.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,26 @@ jobs:
3333

3434
- name: Pack Ursa
3535
if: ${{ github.event.inputs.Ursa == 'true' }}
36-
run: dotnet pack ./src/Ursa -o ./nugets
36+
run: dotnet pack src/Ursa -o nugets
3737

3838
- name: Pack Ursa.Themes.Semi
3939
if: ${{ github.event.inputs.Ursa_Themes_Semi == 'true' }}
40-
run: dotnet pack ./src/Ursa.Themes.Semi -o ./nugets
40+
run: dotnet pack src/Ursa.Themes.Semi -o nugets
4141

4242
- name: Pack Prism Extension
4343
if: ${{ github.event.inputs.PrismExtension == 'true' }}
44-
run: dotnet pack ./src/Ursa.PrismExtension -o ./nugets
44+
run: dotnet pack src/Ursa.PrismExtension -o nugets
4545

4646
- name: Pack ReactiveUI Extension
4747
if: ${{ github.event.inputs.ReactiveUIExtension == 'true' }}
48-
run: dotnet pack ./src/Ursa.ReactiveUIExtension -o ./nugets
48+
run: dotnet pack src/Ursa.ReactiveUIExtension -o nugets
4949

5050
- name: Publish NuGet package
51-
run: dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
51+
run: dotnet nuget push "nugets/*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
5252

5353
- name: Upload a Build Artifact
5454
uses: actions/upload-artifact@v4.3.1
5555
with:
5656
name: nugets
57-
path: ./nugets
57+
path: nugets
5858
if: always()

.github/workflows/publish.yml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ on:
1313
- 'linux'
1414
- 'android'
1515
- 'all'
16-
include_aot:
17-
description: 'Include Windows AOT packaging'
16+
win64:
17+
description: 'Windows x64'
18+
required: true
19+
default: true
20+
type: boolean
21+
win64_aot:
22+
description: 'Windows x64 AOT'
1823
required: true
1924
default: true
2025
type: boolean
@@ -31,34 +36,36 @@ jobs:
3136
run: mkdir upload
3237

3338
- name: Publish win-x64
34-
run: dotnet publish demo/Ursa.Demo.Desktop -r win-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/win64
39+
if: ${{ github.event.inputs.win64 == 'true' }}
40+
run: dotnet publish demo/Ursa.Demo.Desktop -r win-x64 -c Release -o publish/win64 --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
3541

3642
- name: Zip win-x64
43+
if: ${{ github.event.inputs.win64 == 'true' }}
3744
run: |
38-
$files = Get-ChildItem -Path ./publish/win64/* -Recurse -Exclude *.pdb
39-
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Ursa.Demo.Desktop.win-x64.zip
45+
$files = Get-ChildItem -Path publish/win64/* -Recurse -Exclude *.pdb
46+
Compress-Archive -Path $files.FullName -DestinationPath upload/Ursa.Demo.Desktop.win-x64.zip
4047
4148
- name: Enable Native AOT in .csproj
42-
if: ${{ github.event.inputs.include_aot == 'true' }}
49+
if: ${{ github.event.inputs.win64_aot == 'true' }}
4350
run: |
4451
sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj
4552
sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj
4653
4754
- name: Publish win-x64 AOT
48-
if: ${{ github.event.inputs.include_aot == 'true' }}
49-
run: dotnet publish demo/Ursa.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
55+
if: ${{ github.event.inputs.win64_aot == 'true' }}
56+
run: dotnet publish demo/Ursa.Demo.Desktop -r win-x64 -c Release -o publish/win64-aot
5057

5158
- name: Zip win-x64 AOT
52-
if: ${{ github.event.inputs.include_aot == 'true' }}
59+
if: ${{ github.event.inputs.win64_aot == 'true' }}
5360
run: |
54-
$files = Get-ChildItem -Path ./publish/win64-aot/* -Recurse -Exclude *.pdb
55-
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Ursa.Demo.Desktop.win-x64.NativeAOT.zip
61+
$files = Get-ChildItem -Path publish/win64-aot/* -Recurse -Exclude *.pdb
62+
Compress-Archive -Path $files.FullName -DestinationPath upload/Ursa.Demo.Desktop.win-x64.NativeAOT.zip
5663
5764
- name: Upload a Build Artifact
5865
uses: actions/upload-artifact@v4.3.1
5966
with:
6067
name: windows
61-
path: ./upload
68+
path: upload
6269

6370
linux:
6471
if: ${{ github.event.inputs.platform == 'linux' || github.event.inputs.platform == 'all' }}
@@ -71,16 +78,16 @@ jobs:
7178
run: mkdir upload
7279

7380
- name: Publish linux-x64
74-
run: dotnet publish demo/Ursa.Demo.Desktop -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/linux64
81+
run: dotnet publish demo/Ursa.Demo.Desktop -r linux-x64 -c Release -o publish/linux64 --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
7582

7683
- name: Zip linux-x64
77-
run: zip -j -r ./upload/Ursa.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
84+
run: zip -j -r upload/Ursa.Demo.Desktop.linux-x64.zip publish/linux64 -x "*.pdb"
7885

7986
- name: Upload a Build Artifact
8087
uses: actions/upload-artifact@v4.3.1
8188
with:
8289
name: linux
83-
path: ./upload
90+
path: upload
8491

8592
android:
8693
if: ${{ github.event.inputs.platform == 'android' || github.event.inputs.platform == 'all' }}
@@ -90,16 +97,16 @@ jobs:
9097
uses: actions/checkout@v4.1.1
9198

9299
- name: CD Android
93-
run: cd ./demo/Ursa.Demo.Android
100+
run: cd demo/Ursa.Demo.Android
94101

95102
- name: Restore Dependencies
96103
run: dotnet restore
97104

98105
- name: Publish Android
99-
run: dotnet publish demo/Ursa.Demo.Android -c Release -f net8.0-android --no-restore -o ./publish -p:RuntimeIdentifier=android-arm64
106+
run: dotnet publish demo/Ursa.Demo.Android -c Release -f net8.0-android --no-restore -o publish -p:RuntimeIdentifier=android-arm64
100107

101108
- name: Upload a Build Artifact
102109
uses: actions/upload-artifact@v4.3.1
103110
with:
104111
name: android
105-
path: ./publish/*Signed.apk
112+
path: publish/*Signed.apk

.github/workflows/release-tag.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ jobs:
1515
uses: actions/checkout@v4
1616

1717
- name: Pack Ursa
18-
run: dotnet pack ./src/Ursa -o ./nugets
18+
run: dotnet pack src/Ursa -o nugets
1919

2020
- name: Pack Ursa.Themes.Semi
21-
run: dotnet pack ./src/Ursa.Themes.Semi -o ./nugets
21+
run: dotnet pack src/Ursa.Themes.Semi -o nugets
2222

2323
- name: Upload a Build Artifact
2424
uses: actions/upload-artifact@v4
2525
with:
2626
name: nugets
27-
path: ./nugets
27+
path: nugets
2828

2929
publish-windows:
3030
runs-on: windows-latest
@@ -36,31 +36,31 @@ jobs:
3636
run: mkdir upload
3737

3838
- name: Publish win-x64
39-
run: dotnet publish demo/Ursa.Demo.Desktop -r win-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/win64
39+
run: dotnet publish demo/Ursa.Demo.Desktop -r win-x64 -c Release -o publish/win64 --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
4040

4141
- name: Zip win-x64
4242
run: |
43-
$files = Get-ChildItem -Path ./publish/win64/* -Recurse -Exclude *.pdb
44-
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Ursa.Demo.Desktop.win-x64.zip
43+
$files = Get-ChildItem -Path publish/win64/* -Recurse -Exclude *.pdb
44+
Compress-Archive -Path $files.FullName -DestinationPath upload/Ursa.Demo.Desktop.win-x64.zip
4545
4646
- name: Enable Native AOT in .csproj
4747
run: |
4848
sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj
4949
sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj
5050
5151
- name: Publish win-x64 AOT
52-
run: dotnet publish demo/Ursa.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
52+
run: dotnet publish demo/Ursa.Demo.Desktop -r win-x64 -c Release -o publish/win64-aot
5353

5454
- name: Zip win-x64 AOT
5555
run: |
56-
$files = Get-ChildItem -Path ./publish/win64-aot/* -Recurse -Exclude *.pdb
57-
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Ursa.Demo.Desktop.win-x64.NativeAOT.zip
56+
$files = Get-ChildItem -Path publish/win64-aot/* -Recurse -Exclude *.pdb
57+
Compress-Archive -Path $files.FullName -DestinationPath upload/Ursa.Demo.Desktop.win-x64.NativeAOT.zip
5858
5959
- name: Upload a Build Artifact
6060
uses: actions/upload-artifact@v4
6161
with:
6262
name: windows
63-
path: ./upload
63+
path: upload
6464

6565
publish-linux:
6666
runs-on: ubuntu-latest
@@ -72,16 +72,16 @@ jobs:
7272
run: mkdir upload
7373

7474
- name: Publish linux-x64
75-
run: dotnet publish demo/Ursa.Demo.Desktop -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/linux64
75+
run: dotnet publish demo/Ursa.Demo.Desktop -r linux-x64 -c Release -o publish/linux64 --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
7676

7777
- name: Zip linux-x64
78-
run: zip -j -r ./upload/Ursa.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
78+
run: zip -j -r upload/Ursa.Demo.Desktop.linux-x64.zip publish/linux64 -x "*.pdb"
7979

8080
- name: Upload a Build Artifact
8181
uses: actions/upload-artifact@v4
8282
with:
8383
name: linux
84-
path: ./upload
84+
path: upload
8585

8686
publish-android:
8787
runs-on: windows-latest
@@ -90,19 +90,19 @@ jobs:
9090
uses: actions/checkout@v4
9191

9292
- name: CD Android
93-
run: cd ./demo/Ursa.Demo.Android
93+
run: cd demo/Ursa.Demo.Android
9494

9595
- name: Restore Dependencies
9696
run: dotnet restore
9797

9898
- name: Publish Android
99-
run: dotnet publish demo/Ursa.Demo.Android -c Release -f net8.0-android --no-restore -o ./publish -p:RuntimeIdentifier=android-arm64
99+
run: dotnet publish demo/Ursa.Demo.Android -c Release -f net8.0-android --no-restore -o publish -p:RuntimeIdentifier=android-arm64
100100

101101
- name: Upload a Build Artifact
102102
uses: actions/upload-artifact@v4
103103
with:
104104
name: android
105-
path: ./publish/*Signed.apk
105+
path: publish/*Signed.apk
106106

107107
draft-release:
108108
needs: [ pack, publish-windows, publish-linux, publish-android ]

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Test
22

33
on:
44
push:
5-
branches: [ "main", "action/publish" ]
5+
branches: [ "main" ]
66
pull_request:
77
branches: [ "main" ]
88
workflow_dispatch:
@@ -14,16 +14,16 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v4.1.1
1616
- name: Ursa Unit Test
17-
run: dotnet test ./tests/Test.Ursa
17+
run: dotnet test tests/Test.Ursa
1818
- name: Ursa Headless Test
19-
run: dotnet test ./tests/HeadlessTest.Ursa
19+
run: dotnet test tests/HeadlessTest.Ursa
2020

2121
ubuntu:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Checkout
2525
uses: actions/checkout@v4.1.1
2626
- name: Ursa Unit Test
27-
run: dotnet test ./tests/Test.Ursa
27+
run: dotnet test tests/Test.Ursa
2828
- name: Ursa Headless Test
29-
run: dotnet test ./tests/HeadlessTest.Ursa
29+
run: dotnet test tests/HeadlessTest.Ursa

Ursa.sln

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.Ursa", "tests\Test.Urs
3939
EndProject
4040
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeadlessTest.Ursa", "tests\HeadlessTest.Ursa\HeadlessTest.Ursa.csproj", "{2D1C279E-7FFF-4630-92CC-CB2C33C3F80F}"
4141
EndProject
42+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Action", "GitHub Action", "{66123AC1-7C8C-4AA0-BBDB-5CC3E647A741}"
43+
ProjectSection(SolutionItems) = preProject
44+
.github\workflows\deploy.yml = .github\workflows\deploy.yml
45+
.github\workflows\pack.yml = .github\workflows\pack.yml
46+
.github\workflows\pack-nightly.yml = .github\workflows\pack-nightly.yml
47+
.github\workflows\publish.yml = .github\workflows\publish.yml
48+
.github\workflows\release-tag.yml = .github\workflows\release-tag.yml
49+
.github\workflows\test.yml = .github\workflows\test.yml
50+
EndProjectSection
51+
EndProject
4252
Global
4353
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4454
Debug|Any CPU = Debug|Any CPU

0 commit comments

Comments
 (0)