-
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.41 KB
/
publish-releaseV2.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# This is an experimental GH Action File. We're not yet sure whether this will have the desired effect
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:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Build
shell: bash
run: |
# Define some variables for things we need
tag=$(git describe --tags --abbrev=0)
release_name="IISLogManager.CLI-$tag-${{ matrix.target }}"
# Build everything
dotnet publish src/IISLogManager.CLI/IISLogManager.CLI.csproj --framework net6.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name"
# Pack files
if [ "${{ matrix.target }}" == "win-x64" ]; then
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: "IISLogManager.CLI*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}