Use matrix for publish job
This commit is contained in:
parent
5ba05bdb91
commit
aa2707d8a5
56
.github/workflows/ci.yml
vendored
56
.github/workflows/ci.yml
vendored
@ -52,23 +52,47 @@ jobs:
|
|||||||
run: cd src/MyWebLog.Tests; dotnet run -f net${{ matrix.dotnet-version }}
|
run: cd src/MyWebLog.Tests; dotnet run -f net${{ matrix.dotnet-version }}
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
name: Publish .zip / .bz2 Packages
|
name: Publish Packages
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build_and_test
|
needs: build_and_test
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
ver:
|
||||||
|
- "net6.0"
|
||||||
|
- "net7.0"
|
||||||
|
- "net8.0"
|
||||||
|
os:
|
||||||
|
- "linux-x64"
|
||||||
|
- "win-x64"
|
||||||
|
include:
|
||||||
|
- os: "linux-x64"
|
||||||
|
bz2: true
|
||||||
|
- os: "win-x64"
|
||||||
|
zip: true
|
||||||
steps:
|
steps:
|
||||||
- name: Check Out Code
|
- name: Check Out Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Setup .NET Core SDK
|
- name: Setup .NET Core SDK
|
||||||
uses: actions/setup-dotnet@v4.0.0
|
uses: actions/setup-dotnet@v4.0.0
|
||||||
with:
|
with:
|
||||||
dotnet-version: 8.x
|
dotnet-version: 8.x
|
||||||
- name: Create Release Packages
|
- name: Publish (Release)
|
||||||
run: dotnet run build.fsproj CI
|
run: dotnet publish -c Release -f ${{ matrix.ver }} -r ${{ matrix.os }} src/MyWebLog/MyWebLog.fsproj
|
||||||
- name: Upload Artifacts
|
- name: Zip Admin Theme
|
||||||
uses: actions/upload-artifact@v4
|
run: cd src/admin-theme; zip -r ../MyWebLog/bin/Release/${{ matrix.ver }}/${{ matrix.os }}/publish/admin-theme.zip *; cd ../..
|
||||||
with:
|
- name: Zip Default Theme
|
||||||
name: release-packages
|
run: cd src/default-theme; zip -r ../MyWebLog/bin/Release/${{ matrix.ver }}/${{ matrix.os }}/publish/default-theme.zip *; cd ../..
|
||||||
path: |
|
- if: ${{ matrix.bz2 }}
|
||||||
release/*x64.zip
|
name: Create .tar.bz2 Archive
|
||||||
release/*.bz2
|
run: tar cfj myWebLog-${{ matrix.ver }}-${{ matrix.os }}.tar.bz2 -C src/MyWebLog/bin/Release/${{ matrix.ver }}/${{ matrix.os }}/publish .
|
||||||
|
- if: ${{ matrix.zip }}
|
||||||
|
name: Create .zip Archive
|
||||||
|
run: cd src/MyWebLog/bin/Release/${{ matrix.ver }}/${{ matrix.os }}/publish; zip -r myWebLog-${{ matrix.ver }}-${{ matrix.os }}.zip *; cp myWeb*.zip ../../../../../../..; cd ../../../../../../..
|
||||||
|
- name: Upload Artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release-packages
|
||||||
|
path: |
|
||||||
|
*x64.zip
|
||||||
|
*.bz2
|
||||||
|
Loading…
Reference in New Issue
Block a user