Skip to content

Commit

Permalink
Fix package build (#1)
Browse files Browse the repository at this point in the history
PowerPointToOSC package is now created automatically with GitHub Actions
  • Loading branch information
ojacques committed Nov 14, 2021
1 parent 6c3e32a commit f83aa33
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 20 deletions.
41 changes: 34 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build and Package

on: [push, workflow_dispatch]
on: [push]

jobs:

Expand All @@ -12,19 +12,46 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

# We need msbuild
# We need msbuild and NuGet
- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: Setup NuGet
uses: NuGet/setup-nuget@v1

- name: Restore NuGet Packages
run: nuget restore PowerPointToOSC.sln

# Build artifacts
- name: Build
run: msbuild.exe PowerPointToOSC.sln /t:restore;rebuild;publish /p:PublishSingleFile=True /p:SelfContained=True /p:RuntimeIdentifier=win10-x64 /p:Configuration=Release
run: msbuild PowerPointToOSC.sln /p:RuntimeIdentifier=win-x64 /p:Configuration=Release

# Upload artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Dist
path: |
./dist/*
!./dist/.keep
name: PowerPointToOSC
path: bin\Release\net48\win-x64
retention-days: 7

- name: Generate zip bundle
run: 7z a -tzip PowerPointToOSC.zip .\bin\Release\net48\win-x64\*

- if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
name: Publish latest pre-release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
files: |
PowerPointToOSC.zip
- if: startsWith(github.ref, 'refs/tags/v')
name: Publish tagged release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
PowerPointToOSC.zip
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ publish/
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
#*.pubxml
#*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
Expand Down
15 changes: 4 additions & 11 deletions PowerPointToOSC.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net48</TargetFramework>
<AssemblyName>PowerPointToOSC</AssemblyName>
<RootNamespace>PowerPointToOSC</RootNamespace>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>

<ItemGroup>
<COMReference Include="Microsoft.Office.Interop.PowerPoint">
<Guid>{91493440-5a91-11cf-8700-00aa0060263b}</Guid>
<VersionMajor>2</VersionMajor>
<VersionMinor>12</VersionMinor>
<WrapperTool>primary</WrapperTool>
<Lcid>0</Lcid>
<Isolated>false</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<PackageReference Include="Microsoft.Office.Interop.PowerPoint" Version="15.0.4420.1017" />
</ItemGroup>

<ItemGroup>
Expand Down
18 changes: 18 additions & 0 deletions Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\Publish</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net48</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishTrimmed>False</PublishTrimmed>
</PropertyGroup>
</Project>

0 comments on commit f83aa33

Please sign in to comment.