-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.54 KB
/
Copy pathrelease.yml
File metadata and controls
57 lines (47 loc) · 1.54 KB
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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Version suffix (X.X). Release title becomes YYYYMMDD.X.X"
required: true
default: "0.1"
type: string
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Set version
id: ver
shell: pwsh
run: |
$jst = [System.TimeZoneInfo]::FindSystemTimeZoneById('Tokyo Standard Time')
$now = [System.TimeZoneInfo]::ConvertTimeFromUtc([DateTime]::UtcNow, $jst)
$version = "$($now.ToString('yyyyMMdd')).${{ inputs.version }}"
"version=$version" >> $env:GITHUB_OUTPUT
Write-Host "version=$version"
- name: Restore
run: dotnet restore src/WildsSim.sln
- name: Publish (win-x64, self-contained)
run: >
dotnet publish src/WildsSim/WildsSim.csproj
-c Release -r win-x64 --self-contained true
-o publish
- name: Zip
shell: pwsh
run: Compress-Archive -Path publish/* -DestinationPath "WildsSim-${{ steps.ver.outputs.version }}.zip"
- name: Create draft release
uses: softprops/action-gh-release@v2
with:
draft: true
name: ${{ steps.ver.outputs.version }}
tag_name: ${{ steps.ver.outputs.version }}
files: WildsSim-${{ steps.ver.outputs.version }}.zip