Draft Release 2.61.1 #2
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
| # | |
| # This workflow builds a patched up KeePass.exe that uses larger | |
| # font and packages it along with a few more files in an archive | |
| # file, which is uploaded to a GitHub draft release as an asset. | |
| # | |
| # GitHub maintains workflow run numbers per file name. This file | |
| # should be renamed in the new release branch to start a new | |
| # sequence. | |
| # | |
| name: Draft Release 2.61.1 | |
| on: workflow_dispatch | |
| env: | |
| VERSION: 2.61.1 | |
| BUILD_NUMBER: ${{ github.run_number }} | |
| jobs: | |
| build-packages: | |
| name: Build KeePassFont | |
| runs-on: windows-2022 | |
| strategy: | |
| matrix: | |
| display-scaling: | |
| - 125pct | |
| - 150pct | |
| - 200pct | |
| version-ref: | |
| - 2-61-1 | |
| # this path is valid only for the windows-2022 runner | |
| env: | |
| VCVARSALL: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall' | |
| defaults: | |
| run: | |
| shell: cmd | |
| steps: | |
| - uses: actions/checkout@v6 | |
| name: Checkout source | |
| with: | |
| # fetch the entire history, so we don't have to guess how many commits we need to go back for patching tags | |
| fetch-depth: 0 | |
| # patch the original forms (the `for` loop) with the display scaling patches | |
| - name: Patch for ${{ matrix.display-scaling }} | |
| run: | | |
| git diff keepass-${{ matrix.version-ref }} ${{ matrix.version-ref }}-${{ matrix.display-scaling }} -- KeePass/Forms/*.Designer.cs > ${{ matrix.version-ref }}-${{ matrix.display-scaling }}.patch | |
| for /F %%p in ('dir /B KeePass\Forms\*.Designer.cs') do git show keepass-${{ matrix.version-ref }}:KeePass/Forms/%%p > KeePass\Forms\%%p | |
| patch.exe -p1 --binary --input ${{ matrix.version-ref }}-${{ matrix.display-scaling }}.patch | |
| # build all projects in the solution | |
| - name: Build KeePass.exe | |
| run: | | |
| call "${{ env.VCVARSALL }}" x64 | |
| msbuild /nologo /target:Rebuild /property:Configuration=Release;Platform="Any CPU" /nr:false KeePass_N48.sln | |
| # collect and package only files that can be dropped into the installation folder | |
| # run 7z with different compression levels (-mxN) until Microsoft Defender stops erroneously reporting a virus in the artifacts | |
| - name: Create package | |
| run: | | |
| mkdir KeePassFont-${{ env.VERSION }} | |
| mkdir KeePassFont-${{ env.VERSION }}\XSL\ | |
| copy /y Build\KeePass\Release\KeePass.exe KeePassFont-${{ env.VERSION }}\ | |
| copy /y Ext\XSL\KDBX_Dump_HTML.xsl KeePassFont-${{ env.VERSION }}\XSL\ | |
| copy /y README.md KeePassFont-${{ env.VERSION }}\ | |
| 7z a -mx7 KeePassFont-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.windows.x64.${{ matrix.display-scaling }}.zip KeePassFont-${{ env.VERSION }}\ | |
| - name: Upload packages | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: KeePassFont-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.${{ matrix.display-scaling }} | |
| path: KeePassFont-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.windows.x64.${{ matrix.display-scaling }}.zip | |
| create-draft-release: | |
| name: Create a draft release | |
| runs-on: ubuntu-22.04 | |
| needs: | |
| - build-packages | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v6 | |
| # without `name` downloads all artifacts | |
| with: | |
| path: . | |
| # collect all artifacts in the current directory | |
| merge-multiple: true | |
| # create an draft release and upload build artifacts | |
| - name: Create a draft release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| token : ${{ secrets.GITHUB_TOKEN }} | |
| tag_name: ${{ env.VERSION }} | |
| target_commitish: ${{ github.ref_name }} | |
| name: KeePassFont ${{ env.VERSION }} | |
| draft: true | |
| files: | | |
| KeePassFont-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.windows.x64.125pct.zip | |
| KeePassFont-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.windows.x64.150pct.zip | |
| KeePassFont-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.windows.x64.200pct.zip |