Skip to content

Publish

Publish #117

Workflow file for this run

# -v | --verbosity <LEVEL> # Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. The default is minimal.
name: Publish
concurrency:
cancel-in-progress: true
group: '**'
defaults:
run:
shell: bash
on:
push:
branches:
- release/*
workflow_dispatch:
permissions:
contents: write
jobs:
publish_and_pack_job:
name: Publish and pack
outputs:
tag_version: ${{ steps.getVersionStepId.outputs.version }}
runs-on: ${{ matrix.runtime.os }}
strategy:
fail-fast: true
matrix:
runtime:
- { name: linux-arm64, os: ubuntu-latest }
# - { name: linux-x64, os: ubuntu-latest }
- { name: win-x64, os: windows-latest }
steps:
- name: Checkout Repository
uses: actions/checkout@main
- name: Setup dotnet
uses: actions/setup-dotnet@main
with:
dotnet-version: 8.0.x
- name: Install wasm
run: dotnet workload restore ./src/BlazorWebApp/Client/Seedysoft.BlazorWebApp.Client.csproj
- name: Make publish folder "./${{ matrix.runtime.name }}/"
run: mkdir -p "./${{ matrix.runtime.name }}/"
- name: Build Outbox
run: |
dotnet build "./src/Outbox/ConsoleApp/Seedysoft.Outbox.ConsoleApp.csproj" -c Release --nologo -v m
dotnet publish "./src/Outbox/ConsoleApp/Seedysoft.Outbox.ConsoleApp.csproj" -o "./${{ matrix.runtime.name }}/" -r "${{ matrix.runtime.name }}" -c Release --no-restore --nologo -p:PublishTrimmed=false --sc -v m
- name: Build Pvpc
run: |
dotnet build "./src/Pvpc/ConsoleApp/Seedysoft.Pvpc.ConsoleApp.csproj" -c Release --nologo -v m
dotnet publish "./src/Pvpc/ConsoleApp/Seedysoft.Pvpc.ConsoleApp.csproj" -o "./${{ matrix.runtime.name }}/" -r "${{ matrix.runtime.name }}" -c Release --no-restore --nologo -p:PublishTrimmed=false --sc -v m
- name: Build WebComparer
run: |
dotnet build "./src/WebComparer/ConsoleApp/Seedysoft.WebComparer.ConsoleApp.csproj" -c Release --nologo -v m
dotnet publish "./src/WebComparer/ConsoleApp/Seedysoft.WebComparer.ConsoleApp.csproj" -o "./${{ matrix.runtime.name }}/" -r "${{ matrix.runtime.name }}" -c Release --no-restore --nologo -p:PublishTrimmed=false --sc -v m
- name: Build BlazorWebApp
run: |
dotnet build "./src/BlazorWebApp/Server/Seedysoft.BlazorWebApp.Server.csproj" -c Release --nologo -v m
dotnet publish "./src/BlazorWebApp/Server/Seedysoft.BlazorWebApp.Server.csproj" -o "./${{ matrix.runtime.name }}/" -r "${{ matrix.runtime.name }}" -c Release --no-restore --nologo -p:PublishTrimmed=false --sc -v m
- name: Get Version from project file
id: getVersionStepId
run: |
echo "version=$(grep -m 1 '"Seedysoft.BlazorWebApp.Server/' ./${{ matrix.runtime.name }}/Seedysoft.BlazorWebApp.Server.deps.json | grep -Eo '[[:digit:]]{2}\.[[:digit:]]{1,4}\.[[:digit:]]{1,4}')" >> $GITHUB_OUTPUT
echo ${{ steps.getVersionStepId.outputs.version }}
# - name: Pack to ${{ matrix.runtime.name }}.${{ steps.getVersionStepId.outputs.version }}.7z
# id: pack
# run: |
# cd ${{ matrix.runtime.name }}/
# 7z a -r -t7z "../${{ matrix.runtime.name }}.${{ steps.getVersionStepId.outputs.version }}.7z" *
# cd ..
- name: Start Creating Velopack Release
run: |
dotnet tool install -g vpk
vpk download github --repoUrl ${{ github.server_url }}/${{ github.repository }}
- name: Create and Upload Velopack on Linux
if: ${{ startsWith(matrix.runtime.name, 'linux') }}
run: |
vpk [linux] pack --channel linux --delta BestSize --mainExe "Seedysoft.BlazorWebApp.Server.dll" --outputDir "./vpk-${{ matrix.runtime.name }}" --packDir "./${{ matrix.runtime.name }}" --packId Seedysoft.BlazorWebApp --packVersion "${{ steps.getVersionStepId.outputs.version }}" --runtime "${{ matrix.runtime.name }}"
vpk upload github --repoUrl ${{ github.server_url }}/${{ github.repository }} --channel linux --merge --outputDir "./vpk-${{ matrix.runtime.name }}" --publish --releaseName "${{ steps.getVersionStepId.outputs.version }}" --tag "${{ steps.getVersionStepId.outputs.version }}" --token ${{ secrets.GITHUB_TOKEN }}
- name: Create and Upload Velopack on Windows
if: ${{ startsWith(matrix.runtime.name, 'win') }}
run: |
vpk [win] pack --channel win --delta BestSize --mainExe "Seedysoft.BlazorWebApp.Server.exe" --outputDir "./vpk-${{ matrix.runtime.name }}" --packDir "./${{ matrix.runtime.name }}" --packId Seedysoft.BlazorWebApp --packVersion "${{ steps.getVersionStepId.outputs.version }}" --runtime "${{ matrix.runtime.name }}"
vpk upload github --repoUrl ${{ github.server_url }}/${{ github.repository }} --channel win --merge --outputDir "./vpk-${{ matrix.runtime.name }}" --publish --releaseName "${{ steps.getVersionStepId.outputs.version }}" --tag "${{ steps.getVersionStepId.outputs.version }}" --token ${{ secrets.GITHUB_TOKEN }}
# - name: Upload artifact ${{ matrix.runtime.name }}.${{ steps.getVersionStepId.outputs.version }}.7z
# if: steps.packStepId.outcome == 'success'
# uses: actions/upload-artifact@main
# with:
# name: vpk-${{ matrix.runtime.name }}
# path: vpk-${{ matrix.runtime.name }}
# # https://github.com/actions/upload-artifact?tab=readme-ov-file#altering-compressions-level-speed-v-size
# compression-level: 9
# if-no-files-found: error # `warn` or `ignore` are also available, defaults to `warn`
# release_job:
# name: Create a release
# needs: publish_and_pack_job
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Repository
# uses: actions/checkout@main
# - name: Make download folder
# run: mkdir -p ./artifacts/
# - name: Download published app as artifact
# uses: actions/download-artifact@main
# with:
# path: ./artifacts
# - name: Create a tag
# run: |
# git tag ${{ needs.publish_and_pack_job.outputs.tag_version }}
# git push origin ${{ needs.publish_and_pack_job.outputs.tag_version }}
# - name: Make Release
# uses: softprops/action-gh-release@v2
# with:
# name: ${{ needs.publish_and_pack_job.outputs.tag_version }}
# fail_on_unmatched_files: true
# files: ./artifacts/*/*.7z
# generate_release_notes: true
# tag_name: ${{ needs.publish_and_pack_job.outputs.tag_version }}