Skip to content

Commit db29f75

Browse files
authored
Add CI (#3)
* Add CI
1 parent ba27c98 commit db29f75

File tree

4 files changed

+51
-14
lines changed

4 files changed

+51
-14
lines changed

Diff for: .github/workflows/ci.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
name: Release
10+
strategy:
11+
matrix:
12+
kind: ['windows']
13+
include:
14+
- kind: windows
15+
os: windows-latest
16+
target: win-x64
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
- name: Setup dotnet
22+
uses: actions/setup-dotnet@v2
23+
with:
24+
dotnet-version: 6.0.x
25+
- name: Build
26+
shell: bash
27+
run: |
28+
tag=$(git describe --tags --abbrev=0)
29+
release_name="GitTimelapseView-$tag-${{ matrix.target }}"
30+
31+
# Build everything
32+
dotnet publish GitTimelapseView/GitTimelapseView.csproj --framework net6.0-windows --runtime "${{ matrix.target }}" -c Release -o "$release_name"
33+
34+
# Pack files
35+
if [ "${{ matrix.target }}" == "win-x64" ]; then
36+
# Pack to zip for Windows
37+
7z a -tzip "${release_name}.zip" "./${release_name}/*"
38+
else
39+
tar czvf "${release_name}.tar.gz" "$release_name"
40+
fi
41+
42+
# Delete output directory
43+
rm -r "$release_name"
44+
- name: Publish
45+
uses: softprops/action-gh-release@v1
46+
with:
47+
files: "GitTimelapseView-*"
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Diff for: Directory.Build.props

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
2020
<DefaultItemExcludes>$(DefaultItemExcludes);publish/**/*</DefaultItemExcludes>
2121
<Nullable>enable</Nullable>
22+
<IsPackable>false</IsPackable>
2223
</PropertyGroup>
2324

2425
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' == 'true'">

Diff for: GitTimelapseView/GitTimelapseView.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<OutputType>WinExe</OutputType>
55
<UseWPF>true</UseWPF>
66
<ApplicationIcon>Wpf\Resources\appicon.ico</ApplicationIcon>
7+
<IsPackable>true</IsPackable>
78
</PropertyGroup>
89

910
<ItemGroup>

Diff for: GitTimelapseView/Properties/PublishProfiles/FolderProfile.pubxml

-14
This file was deleted.

0 commit comments

Comments
 (0)