forked from Dliix66/DiscordStatus
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (65 loc) · 1.9 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
65
66
67
68
69
70
71
72
73
74
75
76
name: .NET Build and Release
on:
push:
branches:
- main
- master
- dev
pull_request:
branches:
- main
- master
- dev
jobs:
build:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/dotnet/nightly/sdk:7.0
steps:
- uses: actions/checkout@v2
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet publish --configuration Debug
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: net7.0-artifacts
path: |
bin/Debug/net7.0/publish/DiscordStatus.deps.json
bin/Debug/net7.0/publish/DiscordStatus.pdb
bin/Debug/net7.0/publish/Discord*.dll
bin/Debug/net7.0/publish/Newtonsoft.Json.dll
bin/Debug/net7.0/publish/System.Interactive.Async.dll
bin/Debug/net7.0/publish/System.Linq.Async.dll
bin/Debug/net7.0/publish/System.Reactive.dll
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: net7.0-artifacts
path: bin/Debug/net7.0
- name: Create Tag
id: tag_version
run: |
DATE=$(date +'%y.%m.%d-%H%M%S')
echo "RELEASE_TAG=$DATE" >> $GITHUB_ENV
- name: Determine if Pre-release
id: prerelease
run: |
if [ "${{ github.ref }}" != "refs/heads/main" ]; then
echo "IS_PRERELEASE=true" >> $GITHUB_ENV
else
echo "IS_PRERELEASE=false" >> $GITHUB_ENV
fi
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.RELEASE_TAG }}
files: bin/Debug/net7.0/*
prerelease: ${{ env.IS_PRERELEASE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}