-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (64 loc) · 2.53 KB
/
release.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
64
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Setup .NET
uses: xt0rted/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Checkout
uses: actions/checkout@v3
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Update private NuGet source
run: |
dotnet nuget add source --name NoP77svk --username anyone --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text "https://nuget.pkg.github.com/nop77svk/index.json" \
|| dotnet nuget update source NoP77svk --username anyone --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --source "https://nuget.pkg.github.com/nop77svk/index.json"
- name: Build
run: dotnet build -c Release /p:Version=${VERSION}
- name: Test
run: dotnet test -c Release /p:Version=${VERSION} --no-build
# - name: Pack
# run: |
# dotnet pack -c Release /p:Version=${VERSION} --no-build --output .
# - name: Push
# run: dotnet nuget push NoP77svk.*.${VERSION}.nupkg --source https://nuget.pkg.github.com/nop77svk/index.json --api-key ${GITHUB_TOKEN}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare releases
run: |
mkdir _publish.all
- name: Windows x64 Build
run: |
dotnet publish ./jwl.console -c Release -o ./_publish.win-x64 -r win-x64 --self-contained
cd ./_publish.win-x64
cp ../LICENSE .
zip -r9v ../_publish.all/jira-worklogger.${VERSION}.win.x64.zip .
cd ..
# - name: Linux x64 Build
# run: |
# dotnet publish -c Release -o ./_publish.linux-x64 -r linux-x64 --self-contained
# cd ./_publish.linux-x64
# cp ../LICENSE .
# tar cv . | gzip -9c > ../_publish.all/jira-worklogger.${VERSION}.linux.x64.tgz
# cd ..
- name: Portable Build
run: |
dotnet publish ./jwl.console -c Release -o ./_publish.portable --no-self-contained -p:PublishTrimmed=false
cd ./_publish.portable
cp ../LICENSE .
zip -r9v ../_publish.all/jira-worklogger.${VERSION}.portable.zip .
cd ..
- name: Release All Builds
uses: softprops/action-gh-release@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
body: "<changelog should come here>"
prerelease: false
files: |
./_publish.all/jira-worklogger.*