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

View file

@ -1,40 +1,13 @@
<Project>
<PropertyGroup Condition="'$(CI)' != 'true' And Exists('$(ProjectDir)$(ProjectName).Credentials.template')">
<MSBuildCommunityTasksPath>$(PkgMSBuildTasks)\tools\</MSBuildCommunityTasksPath>
</PropertyGroup>
<PropertyGroup Condition="'$(CI)' == 'true' And Exists('$(ProjectDir)$(ProjectName).Credentials.template')">
<MSBuildCommunityTasksPath>$(MSBuildExtensionsPath)\MSBuildCommunityTasks\</MSBuildCommunityTasksPath>
<PropertyGroup Condition="Exists('$(ProjectDir)$(ProjectName).Credentials.template')">
<MSBuildCommunityTasksPath>$(PkgMSBuildTasks)\tools\</MSBuildCommunityTasksPath>
</PropertyGroup>
<Import Project="$(MSBuildCommunityTasksPath)MSBuild.Community.Tasks.Targets" 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"/>
<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>
-->
</Project>

View file

@ -1,7 +1,7 @@

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