Skip to content

Commit

Permalink
Add CI (#3)
Browse files Browse the repository at this point in the history
* Add CI
  • Loading branch information
LaurentM-Ubi authored Apr 25, 2022
1 parent ba27c98 commit db29f75
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 14 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: publish

on:
release:
types: [published]

jobs:
release:
name: Release
strategy:
matrix:
kind: ['windows']
include:
- kind: windows
os: windows-latest
target: win-x64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Build
shell: bash
run: |
tag=$(git describe --tags --abbrev=0)
release_name="GitTimelapseView-$tag-${{ matrix.target }}"
# Build everything
dotnet publish GitTimelapseView/GitTimelapseView.csproj --framework net6.0-windows --runtime "${{ matrix.target }}" -c Release -o "$release_name"
# Pack files
if [ "${{ matrix.target }}" == "win-x64" ]; then
# Pack to zip for Windows
7z a -tzip "${release_name}.zip" "./${release_name}/*"
else
tar czvf "${release_name}.tar.gz" "$release_name"
fi
# Delete output directory
rm -r "$release_name"
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: "GitTimelapseView-*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<DefaultItemExcludes>$(DefaultItemExcludes);publish/**/*</DefaultItemExcludes>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' == 'true'">
Expand Down
1 change: 1 addition & 0 deletions GitTimelapseView/GitTimelapseView.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>WinExe</OutputType>
<UseWPF>true</UseWPF>
<ApplicationIcon>Wpf\Resources\appicon.ico</ApplicationIcon>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
14 changes: 0 additions & 14 deletions GitTimelapseView/Properties/PublishProfiles/FolderProfile.pubxml

This file was deleted.

0 comments on commit db29f75

Please sign in to comment.