-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (53 loc) · 2.15 KB
/
dotnet.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: CI Release
on:
push:
tags:
- 1.*.*
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Set outputs
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" &&
echo "::set-output name=version_tag::${GITHUB_REF#refs/*/}" &&
echo "::set-output name=solution_name::WineBridge.sln"
- name: Restore dependencies
working-directory: src/
run: dotnet restore ${{ steps.vars.outputs.solution_name }}
- name: Publish
working-directory: src/WineBridge
run: dotnet publish --no-restore -c Release --runtime win-x86 --self-contained true
/p:PublishSingleFile=true
/p:FileVersion="${{ steps.vars.outputs.version_tag }}"
/p:Version="${{ steps.vars.outputs.version_tag }}"
/p:AssemblyVersion="${{ steps.vars.outputs.version_tag }}"
--version-suffix "-${{ steps.vars.outputs.sha_short }}"
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
working-directory: src/WineBridge/bin/Release/net6.0/win-x86/publish
name: WineBridge-${{ steps.vars.outputs.sha_short }}
path: WineBridge.exe
- name: Package
working-directory: src/WineBridge/bin/Release/net6.0/win-x86/publish
run: |
echo ${{ steps.vars.outputs.version_tag }} >> VERSION
tar cJvf WineBridge-${{ steps.vars.outputs.sha_short }}.tar.xz WineBridge.exe VERSION
mv WineBridge-${{ steps.vars.outputs.sha_short }}.tar.xz /tmp/WineBridge-${{ steps.vars.outputs.sha_short }}.tar.xz
# Release packages
# --------------------------------------
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: false
prerelease: false
automatic_release_tag: ${{ steps.vars.outputs.version_tag }}
title: ${{ steps.vars.outputs.version_tag }}
files: /tmp/WineBridge-${{ steps.vars.outputs.sha_short }}.tar.xz