-
Notifications
You must be signed in to change notification settings - Fork 6
157 lines (137 loc) · 5.44 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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Package and Release
on:
release:
types: [published]
tags:
- 'v*.*.*'
jobs:
package:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install 7-Zip
run: sudo apt-get install p7zip-full
- name: Extract Version from Tag
run: echo "VERSION=$(echo ${GITHUB_REF} | sed 's/refs\/tags\/v//')" >> $GITHUB_ENV
- name: Copy CHANGELOG.md to Build directory
run: |
mkdir -p Build BuildPreview
cp CHANGELOG.md Build/
cp CHANGELOG.md BuildPreview/
- name: Get Text from last.txt
run: |
LAST_EXPANSION_VERSION=$(curl -s https://raw.githubusercontent.com/HolographicWings/LethalExpansion/main/last.txt)
echo "LAST_EXPANSION_VERSION=$LAST_EXPANSION_VERSION" >> $GITHUB_ENV
- name: Zip files
if: github.event.release.prerelease == false
run: 7z a -tzip -mx=9 ./Build/LethalSDK_Project.zip ./LethalSDK_Project
- name: Zip files
if: github.event.release.prerelease == false
run: 7z a -tzip -mx=9 ./Releases/LethalSDK_v${{ env.VERSION }}.zip ./Build/*
- name: Zip files
if: github.event.release.prerelease == true
run: 7z a -tzip -mx=9 ./BuildPreview/LethalSDK_Project.zip ./LethalSDK_Project
- name: Zip files
if: github.event.release.prerelease == true
run: 7z a -tzip -mx=9 ./Releases/LethalSDK_v${{ env.VERSION }}_pre.zip ./BuildPreview/*
- name: Upload Release Asset Zip
if: github.event.release.prerelease == false
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.LETHAL_SDK_SECRET }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./Releases/LethalSDK_v${{ env.VERSION }}.zip
asset_name: LethalSDK_v${{ env.VERSION }}.zip
asset_content_type: application/zip
- name: Upload Release Asset Zip
if: github.event.release.prerelease == true
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.LETHAL_SDK_SECRET }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./Releases/LethalSDK_v${{ env.VERSION }}_pre.zip
asset_name: LethalSDK_v${{ env.VERSION }}.zip
asset_content_type: application/zip
- name: 7z files
if: github.event.release.prerelease == false
run: 7z a -t7z -mx=9 ./Build/LethalSDK_Project.7z ./LethalSDK_Project
- name: 7z files
if: github.event.release.prerelease == false
run: 7z a -t7z -mx=9 ./Releases/LethalSDK_v${{ env.VERSION }}.7z ./Build/* -x!LethalSDK_Project.zip
- name: 7z files
if: github.event.release.prerelease == true
run: 7z a -t7z -mx=9 ./BuildPreview/LethalSDK_Project.7z ./LethalSDK_Project
- name: 7z files
if: github.event.release.prerelease == true
run: 7z a -t7z -mx=9 ./Releases/LethalSDK_v${{ env.VERSION }}_pre.7z ./BuildPreview/* -x!LethalSDK_Project.zip
- name: Upload Release Asset 7z
if: github.event.release.prerelease == false
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.LETHAL_SDK_SECRET }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./Releases/LethalSDK_v${{ env.VERSION }}.7z
asset_name: LethalSDK_v${{ env.VERSION }}.7z
asset_content_type: application/x-7z-compressed
- name: Upload Release Asset 7z
if: github.event.release.prerelease == true
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.LETHAL_SDK_SECRET }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./Releases/LethalSDK_v${{ env.VERSION }}_pre.7z
asset_name: LethalSDK_v${{ env.VERSION }}.7z
asset_content_type: application/x-7z-compressed
- name: Upload Release Asset Zip
if: github.event.release.prerelease == false
uses: GreenTF/upload-thunderstore-package@v4.3
with:
namespace: HolographicWings
description: Lethal Company Development Kit to easily add new Scraps, Moons and more in future.
token: ${{ secrets.THUNDERSTORE_TOKEN }}
name: LethalSDK
version: ${{ env.VERSION }}
community: lethal-company
repo: thunderstore.io
categories: |
bepinex
items
moons
mods
audio
misc
tools
deps: |
BepInEx-BepInExPack@5.4.2100
HolographicWings-LethalExpansion@${{ env.VERSION }}
website: https://github.com/HolographicWings/LethalSDK-Unity-Project
file: ./Releases/LethalSDK_v${{ env.VERSION }}.zip
- name: Upload Release Asset Zip
if: github.event.release.prerelease == true
uses: GreenTF/upload-thunderstore-package@v4.3
with:
namespace: HolographicWings
description: Preview version of LethalSDK.
token: ${{ secrets.THUNDERSTORE_TOKEN }}
name: LethalSDK_Preview
version: ${{ env.VERSION }}
community: lethal-company
repo: thunderstore.io
categories: |
bepinex
items
moons
mods
audio
misc
tools
deps: |
BepInEx-BepInExPack@5.4.2100
HolographicWings-LethalExpansion@${{ env.VERSION }}
website: https://github.com/HolographicWings/LethalSDK-Unity-Project
file: ./Releases/LethalSDK_v${{ env.VERSION }}_pre.zip