-
-
Notifications
You must be signed in to change notification settings - Fork 12
82 lines (68 loc) · 2.81 KB
/
create_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
77
78
79
80
81
82
name: create-release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version number'
required: true
defaults:
run:
shell: pwsh
jobs:
build:
runs-on: windows-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1.1
- run: msbuild ${{ github.event.repository.name }}.sln -t:rebuild -verbosity:diag -property:Configuration=Release -property:Platform=x64
- run: cp x64\Release\${{ github.event.repository.name }}.asi ${{ github.event.repository.name }}.asi
- uses: robinraju/release-downloader@v1.8
with:
repository: "ThirteenAG/Ultimate-ASI-Loader"
latest: true
fileName: "Ultimate-ASI-Loader_x64.zip"
- name: Prepare Ultimate ASI Loader
run: |
unzip Ultimate-ASI-Loader_x64.zip -d .\
C:\msys64\usr\bin\wget.exe -O .\UltimateASILoader_LICENSE.md https://raw.githubusercontent.com/ThirteenAG/Ultimate-ASI-Loader/master/license
- name: Create Directory Structure
run: |
mkdir .\zip\Steam
mkdir .\zip\Reloaded-II
- name: Prepare Steam/MS files
run: |
cp ${{ github.event.repository.name }}.asi .\zip\Steam\
cp ${{ github.event.repository.name }}.ini .\zip\Steam\
cp dinput8.dll .\zip\Steam\dinput8.dll
cp UltimateASILoader_LICENSE.md .\zip\Steam\
New-Item -Path ".\zip\Steam\EXTRACT_TO_GAME_FOLDER" -ItemType File
- name: Prepare Reloaded-II files
run: |
cp ${{ github.event.repository.name }}.asi .\zip\Reloaded-II\
cp ${{ github.event.repository.name }}.ini .\zip\Reloaded-II\
cp assets\r2-package\ModConfig.json .\zip\Reloaded-II
$pathToJson = ".\zip\Reloaded-II\ModConfig.json"
$version = "${{ github.event.inputs.version }}".TrimStart('v') # Remove 'v' prefix from version
(Get-Content $pathToJson -Raw) -replace '<REPLACED_VERSION_IN_CI>', $version | Set-Content $pathToJson
- name: Create Steam/MS Zip
run: |
cd .\zip\Steam
7z a -r -tzip ..\..\${{ github.event.repository.name }}_${{ github.event.inputs.version }}.zip .\*
- name: Create Reloaded-II Zip
run: |
cd .\zip\Reloaded-II
7z a -r -tzip ..\..\${{ github.event.repository.name }}_Reloaded-II.zip .\*
- uses: ncipollo/release-action@v1
with:
artifacts: "${{ github.event.repository.name }}_${{ github.event.inputs.version }}.zip, ${{ github.event.repository.name }}_Reloaded-II.zip"
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.inputs.version }}
name: "${{ github.event.inputs.version }}"
draft: true
generateReleaseNotes: true
artifactErrorsFailBuild: true