-
Notifications
You must be signed in to change notification settings - Fork 41
130 lines (107 loc) · 4.1 KB
/
beta.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Beta
on:
push:
branches:
- main
workflow_dispatch:
jobs:
beta:
runs-on: windows-latest
steps:
- name: Git - Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Version
id: version
run: |
# Get the current date
$DATE = Get-Date -Format "yyyy.Md"
# Get the current hour and minute without leading zero for the hour
# Get the current hour and minute
$HOUR = [int](Get-Date -Format "HH") # Convert hour to integer to strip any leading zero
# If the hour is 0 (midnight), set it to an empty string
if ($HOUR -eq 0) {
$HOUR = ''
}
$MINUTE = Get-Date -Format "mm" # Keep minutes as-is
# Construct the time, omitting hour if it's empty
$TIME = "$HOUR$MINUTE"
# Construct the version using DATE and TIME
$VERSION = "$DATE.$TIME"
Write-Output "Generated version: $VERSION"
# Export version as an output
echo "version=$VERSION" >> $env:GITHUB_OUTPUT
- name: Version - Update project files
uses: vers-one/[email protected]
with:
file: "src/**/*.csproj"
version: ${{ steps.version.outputs.version }}
- name: Release - Delete unpublished
uses: hugo19941994/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Release - Notes
id: release
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ github.token }}
with:
name: 'Sidekick v${{ steps.version.outputs.version }}'
tag: 'v${{ steps.version.outputs.version }}'
version: 'v${{ steps.version.outputs.version }}'
publish: false
prerelease: true
- name: Environment - Build Number
uses: myci-actions/export-env-var@1
with:
name: BUILD_NUMBER
value: ${{ steps.version.outputs.version }}
- name: Environment - Github Token
uses: myci-actions/export-env-var@1
with:
name: GITHUB_TOKEN
value: ${{ github.token }}
- name: .NET - Setup
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.x
- name: .NET - Tests
shell: pwsh
run: |
dotnet restore
dotnet build --no-restore
dotnet test --no-build --verbosity normal
- name: .NET - Publish
shell: pwsh
run: |
$version = "${{ steps.version.outputs.version }}"
Write-Output "Version: $version"
dotnet publish src/Sidekick.Protocol/Sidekick.Protocol.csproj -p:PublishProfile=Build
dotnet publish src/Sidekick.Wpf/Sidekick.Wpf.csproj -c Release --self-contained true -r win-x64 -o ./Publish
- name: Velopack
shell: pwsh
run: |
$version = "${{ steps.version.outputs.version }}"
Write-Output "Version: $version"
dotnet tool install -g vpk
vpk download github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta
vpk pack --packId Sidekick --packVersion $version --packDir Publish --channel windows-beta
vpk upload github --repoUrl https://github.com/Sidekick-Poe/Sidekick --channel windows-beta --pre --merge --releaseName "Sidekick v$version" --tag v$version --token ${{ github.token }}
- name: Release - Download Instructions
uses: xresloader/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
file: 'download-instructions.txt'
tag_name: 'v${{ steps.version.outputs.version }}'
draft: true
verbose: true
overwrite: true
- name: Release - Remove .nupkg
uses: flcdrg/remove-release-asset-action@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
release_id: ${{ steps.release.outputs.id }}
asset_name: Sidekick-${{ steps.version.outputs.version }}-windows-beta-full.nupkg