Start again

This commit is contained in:
jklingen 2025-02-13 20:25:50 +01:00
commit 82f84a2aa0
3 changed files with 73 additions and 87 deletions

View file

@ -4,72 +4,84 @@ on:
push: push:
branches: branches:
- 'release/1.*' - 'release/1.*'
pull_request:
branches:
- 'release/1.*'
paths-ignore: paths-ignore:
- 'develop/**' - 'develop/**'
jobs: jobs:
build: build:
runs-on: windows-latest runs-on: windows-latest
env:
Box13_ClientId: ${{ secrets.Box13_ClientId }}
Box13_ClientSecret: ${{ secrets.Box13_ClientSecret }}
DropBox13_ClientId: ${{ secrets.DropBox13_ClientId }}
DropBox13_ClientSecret: ${{ secrets.DropBox13_ClientSecret }}
Flickr_ClientId: ${{ secrets.Flickr_ClientId }}
Flickr_ClientSecret: ${{ secrets.Flickr_ClientSecret }}
Imgur13_ClientId: ${{ secrets.Imgur13_ClientId }}
Imgur13_ClientSecret: ${{ secrets.Imgur13_ClientSecret }}
Photobucket_ClientId: ${{ secrets.Photobucket_ClientId }}
Photobucket_ClientSecret: ${{ secrets.Photobucket_ClientSecret }}
Picasa_ClientId: ${{ secrets.Picasa_ClientId }}
Picasa_ClientSecret: ${{ secrets.Picasa_ClientSecret }}
steps: steps:
- name: Checkout repository - uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up .NET - name: Set up .NET
uses: actions/setup-dotnet@v3 uses: actions/setup-dotnet@v3
with: with:
dotnet-version: '5.x.x' dotnet-version: '5.x'
- name: Install Visual Studio Build Tools - name: Restore nuget packages and generate credential templates
run: | run: dotnet restore src/Greenshot.sln --configfile nuget.config --source https://api.nuget.org/v3/index.json
choco install visualstudio2019buildtools --version=16.11.7 env:
choco install microsoft-build-tools --version=15.0.26320.2 Box13_ClientId: ${{ secrets.Box13_ClientId }}
Box13_ClientSecret: ${{ secrets.Box13_ClientSecret }}
DropBox13_ClientId: ${{ secrets.DropBox13_ClientId }}
DropBox13_ClientSecret: ${{ secrets.DropBox13_ClientSecret }}
Flickr_ClientId: ${{ secrets.Flickr_ClientId }}
Flickr_ClientSecret: ${{ secrets.Flickr_ClientSecret }}
Imgur13_ClientId: ${{ secrets.Imgur13_ClientId }}
Imgur13_ClientSecret: ${{ secrets.Imgur13_ClientSecret }}
Photobucket_ClientId: ${{ secrets.Photobucket_ClientId }}
Photobucket_ClientSecret: ${{ secrets.Photobucket_ClientSecret }}
Picasa_ClientId: ${{ secrets.Picasa_ClientId }}
Picasa_ClientSecret: ${{ secrets.Picasa_ClientSecret }}
- name: Install MSBuild Community Tasks - name: Build and package
run: | run: dotnet build src/Greenshot.sln --configuration Release --no-restore
choco install msbuild.communitytasks env:
Box13_ClientId: ${{ secrets.Box13_ClientId }}
Box13_ClientSecret: ${{ secrets.Box13_ClientSecret }}
DropBox13_ClientId: ${{ secrets.DropBox13_ClientId }}
DropBox13_ClientSecret: ${{ secrets.DropBox13_ClientSecret }}
Flickr_ClientId: ${{ secrets.Flickr_ClientId }}
Flickr_ClientSecret: ${{ secrets.Flickr_ClientSecret }}
Imgur13_ClientId: ${{ secrets.Imgur13_ClientId }}
Imgur13_ClientSecret: ${{ secrets.Imgur13_ClientSecret }}
Photobucket_ClientId: ${{ secrets.Photobucket_ClientId }}
Photobucket_ClientSecret: ${{ secrets.Photobucket_ClientSecret }}
Picasa_ClientId: ${{ secrets.Picasa_ClientId }}
Picasa_ClientSecret: ${{ secrets.Picasa_ClientSecret }}
- name: Verify MSBuild is available - name: Copy Files
run: | run: |
echo "Checking MSBuild version" mkdir -p ${{ github.workspace }}/artifacts
if (Test-Path "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe") { cp $(Build.SourcesDirectory)/installer/Greenshot-INSTALLER-*.exe ${{ github.workspace }}/artifacts/
&"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe" -version
} else { - name: Upload Artifact
Write-Error "MSBuild.exe not found" uses: actions/upload-artifact@v2
} with:
name: drop
path: ${{ github.workspace }}/artifacts
- name: Restore NuGet packages deploy:
run: nuget restore src/Greenshot.sln runs-on: windows-latest
needs: build
- name: Build and package steps:
run: | - name: Download Artifact
if (Test-Path "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe") { uses: actions/download-artifact@v2
&"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe" src/Greenshot.sln /p:Configuration=Release with:
} else { name: drop
Write-Error "MSBuild.exe not found"
}
- name: Copy Files to artifact staging directory - name: Create GitHub Release
run: | uses: actions/create-release@v1
mkdir -p ${{ github.workspace }}/artifacts env:
cp ${{ github.workspace }}/installer/Greenshot-INSTALLER-*.exe ${{ github.workspace }}/artifacts GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
- name: Upload Build Artifacts tag_name: v${{ github.run_number }}
uses: actions/upload-artifact@v3 release_name: "Greenshot ${{ github.run_number }} unstable"
with: draft: true
name: drop prerelease: true
path: ${{ github.workspace }}/artifacts files: ${{ github.workspace }}/drop/*.exe

View file

@ -1,40 +1,13 @@
<Project> <Project>
<PropertyGroup Condition="'$(CI)' != 'true' And Exists('$(ProjectDir)$(ProjectName).Credentials.template')"> <PropertyGroup Condition="Exists('$(ProjectDir)$(ProjectName).Credentials.template')">
<MSBuildCommunityTasksPath>$(PkgMSBuildTasks)\tools\</MSBuildCommunityTasksPath> <MSBuildCommunityTasksPath>$(PkgMSBuildTasks)\tools\</MSBuildCommunityTasksPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(CI)' == 'true' And Exists('$(ProjectDir)$(ProjectName).Credentials.template')">
<MSBuildCommunityTasksPath>$(MSBuildExtensionsPath)\MSBuildCommunityTasks\</MSBuildCommunityTasksPath>
</PropertyGroup>
<Import Project="$(MSBuildCommunityTasksPath)MSBuild.Community.Tasks.Targets" Condition="Exists('$(ProjectDir)$(ProjectName).Credentials.template')"/> <Import Project="$(MSBuildCommunityTasksPath)MSBuild.Community.Tasks.Targets" Condition="Exists('$(ProjectDir)$(ProjectName).Credentials.template')"/>
<!--
<Target Name="ProcessTemplates" BeforeTargets="PrepareForBuild" Condition="Exists('$(ProjectDir)$(ProjectName).Credentials.template')"> <Target Name="ProcessTemplates" BeforeTargets="PrepareForBuild" Condition="Exists('$(ProjectDir)$(ProjectName).Credentials.template')">
<Message Text="Processing: $(ProjectDir)$(ProjectName).Credentials.template" Importance="high"/> <Message Text="Processing: $(ProjectDir)$(ProjectName).Credentials.template" Importance="high"/>
<TemplateFile Template="$(ProjectDir)$(ProjectName).Credentials.template" OutputFilename="$(ProjectDir)$(ProjectName).Credentials.cs" Tokens="@(Tokens)" /> <TemplateFile Template="$(ProjectDir)$(ProjectName).Credentials.template" OutputFilename="$(ProjectDir)$(ProjectName).Credentials.cs" Tokens="@(Tokens)" />
<!- - Read the content of the template - ->
<ReadLinesFromFile File="$(ProjectDir)$(ProjectName).Credentials.template">
<Output TaskParameter="Lines" ItemName="TemplateLines"/>
</ReadLinesFromFile>
<!- - Output each line of the file to the log - ->
<Message Text="Contents of $(ProjectDir)$(ProjectName).Credentials.template:" Importance="high"/>
<Message Text="%(TemplateLines.Identity)" Importance="high"/>
<!- - Read the content of the generated file - ->
<ReadLinesFromFile File="$(ProjectDir)$(ProjectName).Credentials.cs">
<Output TaskParameter="Lines" ItemName="FileLines"/>
</ReadLinesFromFile>
<!- - Output each line of the file to the log - ->
<Message Text="Contents of $(ProjectDir)$(ProjectName).Credentials.cs:" Importance="high"/>
<Message Text="%(FileLines.Identity)" Importance="high"/>
</Target> </Target>
-->
</Project> </Project>

View file

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 17
VisualStudioVersion = 16.0.29728.190 VisualStudioVersion = 17.7.34009.444
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot", "Greenshot\Greenshot.csproj", "{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot", "Greenshot\Greenshot.csproj", "{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
@ -48,6 +48,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\azure-pipelines.yml = ..\azure-pipelines.yml ..\azure-pipelines.yml = ..\azure-pipelines.yml
Directory.Build.props = Directory.Build.props Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets Directory.Build.targets = Directory.Build.targets
..\.github\workflows\release.yml = ..\.github\workflows\release.yml
EndProjectSection EndProjectSection
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot.Editor", "Greenshot.Editor\Greenshot.Editor.csproj", "{148D3C8B-D6EC-4A7D-80E9-243A81F19DD2}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot.Editor", "Greenshot.Editor\Greenshot.Editor.csproj", "{148D3C8B-D6EC-4A7D-80E9-243A81F19DD2}"