Skip to content

Commit 99cccba

Browse files
committed
Fix automated build
1 parent 6fd401f commit 99cccba

7 files changed

Lines changed: 40 additions & 62 deletions

File tree

.github/workflows/build.yml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,25 @@ on:
77
jobs:
88

99
build:
10-
runs-on: [ubuntu-latest]
11-
container: ubuntu:focal
10+
runs-on: ubuntu-latest
1211

1312
steps:
1413
- uses: actions/checkout@v4
15-
- name: Add download.mono-project.com/repo/ubuntu
16-
run: >
17-
apt-get update && apt-get install -y gnupg ca-certificates &&
18-
echo "deb http://download.mono-project.com/repo/ubuntu vs-focal main" > /etc/apt/sources.list.d/mono.list &&
19-
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF &&
20-
apt-get update
21-
- name: Install OS dependencies
22-
run: 'apt-get install -y --no-install-recommends git patch curl zip unzip mono-complete msbuild nuget xvfb'
23-
- name: Get dependencies
24-
run: >
25-
curl -LO https://sourceforge.net/projects/keepass/files/KeePass%202.x/2.18/KeePass-2.18.zip/download &&
26-
curl -LO https://github.com/adrium/ILSpyConvert/releases/latest/download/ILSpyConvert.zip &&
27-
nuget restore &&
28-
unzip download &&
29-
unzip ILSpyConvert.zip &&
30-
cp KeePass.exe packages
31-
- name: Build
32-
run: 'export ILSPYCONVERT=$PWD/ILSpyConvert.exe; ./build/zip.sh && xvfb-run ./build/plgx.sh'
33-
- name: Upload artifacts
34-
uses: actions/upload-artifact@v4
14+
- uses: actions/setup-dotnet@v4
3515
with:
36-
name: PfpConverter
37-
path: PfpConverter.*
16+
dotnet-version: 8.0.x
17+
- name: install dependencies
18+
run: |
19+
sudo apt update
20+
sudo apt install -y xvfb keepass2
21+
curl -L -o kp.zip https://sourceforge.net/projects/keepass/files/KeePass%202.x/2.18/KeePass-2.18.zip/download
22+
unzip -d build kp.zip
23+
- run: xvfb-run ./build/all.sh
24+
- uses: actions/upload-artifact@v4
25+
with:
26+
name: tool
27+
path: output/tool
28+
- uses: actions/upload-artifact@v4
29+
with:
30+
name: plugin
31+
path: output/plugin.plgx

build/all.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
dotnet build -c Release
4+
dotnet build -c Program
5+
dotnet test
6+
7+
mkdir -p output/plugin
8+
cp -v plugin/*plgx* output/plugin
9+
cp -v tool/bin/Release/*/*.dll output/plugin
10+
cat plugin/*.cs | grep ^using | sort -u > output/plugin/Plugin.cs
11+
cat plugin/*.cs | grep ^.assembly: >> output/plugin/Plugin.cs
12+
cat plugin/*.cs | grep -Ev '^(using|.assembly:)' >> output/plugin/Plugin.cs
13+
keepass2 -plgx-create $PWD/output/plugin
14+
15+
mkdir -p output/tool
16+
cp -rv tool/bin/Program/* output/tool/PfpTool

build/plgx.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

build/zip.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

plugin/PfpConverter.plgx.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0" encoding="utf-8"?>
21
<Project>
32
<PropertyGroup>
43
<AssemblyName>PfpConverter</AssemblyName>
@@ -13,8 +12,11 @@
1312
<Reference Include="BouncyCastle.Crypto">
1413
<HintPath>BouncyCastle.Crypto.dll</HintPath>
1514
</Reference>
15+
<Reference Include="PfpTool">
16+
<HintPath>PfpTool.dll</HintPath>
17+
</Reference>
1618
</ItemGroup>
1719
<ItemGroup>
18-
<Compile Include="PfpConverter.cs" />
20+
<Compile Include="Plugin.cs" />
1921
</ItemGroup>
2022
</Project>

plugin/plugin.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<ItemGroup>
1212
<ProjectReference Include="..\tool\tool.csproj" />
1313
<Reference Include="KeePass">
14-
<HintPath>..\packages\KeePass.exe</HintPath>
14+
<HintPath>..\build\KeePass.exe</HintPath>
1515
</Reference>
1616
<Reference Include="System.Drawing" />
1717
<Reference Include="System.Windows.Forms" />

test/test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<ItemGroup>
2626
<Reference Include="KeePass">
27-
<HintPath>..\packages\KeePass.exe</HintPath>
27+
<HintPath>..\build\KeePass.exe</HintPath>
2828
</Reference>
2929
</ItemGroup>
3030

0 commit comments

Comments
 (0)