Set DefaultBackgroundColor to match dark/light theme settings. #21
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: WebViewPlugin Build | |
| on: | |
| push: | |
| tags: | |
| - "[1-9].[0-9]+.[0-9]+" | |
| env: | |
| # Path to the solution file relative to the root of the project. | |
| SOLUTION_FILE_PATH: ./QuickLook.Plugin.WebViewPlus.sln | |
| # Configuration type to build. | |
| # You can convert this to a build matrix if you need coverage of multiple configuration types. | |
| # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
| BUILD_CONFIGURATION: Release | |
| #GITHUB_REF_NAME - short ref name of the branch or tag | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-webapp: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: mooflu/WebViewPlus | |
| ref: master | |
| - name: Detect package manager | |
| id: detect-package-manager | |
| run: | | |
| if [ -f "${{ github.workspace }}/yarn.lock" ]; then | |
| echo "manager=yarn" >> $GITHUB_OUTPUT | |
| echo "command=install" >> $GITHUB_OUTPUT | |
| echo "runner=yarn" >> $GITHUB_OUTPUT | |
| exit 0 | |
| elif [ -f "${{ github.workspace }}/package.json" ]; then | |
| echo "manager=npm" >> $GITHUB_OUTPUT | |
| echo "command=ci" >> $GITHUB_OUTPUT | |
| echo "runner=npx --no-install" >> $GITHUB_OUTPUT | |
| exit 0 | |
| else | |
| echo "Unable to determine package manager" | |
| exit 1 | |
| fi | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: ${{ steps.detect-package-manager.outputs.manager }} | |
| - name: Install dependencies | |
| run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} | |
| - name: Build with vitejs | |
| run: ${{ steps.detect-package-manager.outputs.runner }} vite build | |
| - name: Tar webapp files | |
| run: tar -C ./build -cvf webapp.tar . | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: webapp | |
| path: webapp.tar | |
| build-plugin: | |
| needs: build-webapp | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: master | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: webapp | |
| - name: Untar webapp files | |
| run: tar -C ./webApp -xvf webapp.tar | |
| - name: Add MSBuild to PATH | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Restore NuGet packages | |
| working-directory: ${{github.workspace}} | |
| run: nuget restore ${{env.SOLUTION_FILE_PATH}} | |
| - name: Build | |
| working-directory: ${{github.workspace}} | |
| # Add additional options to the MSBuild command line here (like platform or verbosity level). | |
| # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference | |
| run: | | |
| msbuild /m /p:BuildInParallel=true /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} | |
| cd scripts | |
| powershell ./pack-zip.ps1 | |
| # upload msi and zip artifacts so the publish job below can download and then update latest release via Linux | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: quicklook-plugin | |
| path: QuickLook.Plugin.WebViewPlus.qlplugin | |
| publish: | |
| needs: build-plugin | |
| # one of the steps uses container action which is Linux only | |
| runs-on: ubuntu-latest | |
| permissions: write-all | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: quicklook-plugin | |
| - name: Publish release | |
| # see https://github.com/pyTooling/Actions/tree/main/releaser | |
| uses: pyTooling/Actions/releaser@main | |
| with: | |
| tag: ${{ github.ref_name }} | |
| rm: true | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| files: QuickLook.Plugin.WebViewPlus.qlplugin | |