-
-
Notifications
You must be signed in to change notification settings - Fork 1
274 lines (233 loc) · 9.25 KB
/
create-release.yml
File metadata and controls
274 lines (233 loc) · 9.25 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
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
name: Create Release/Upload Asset
on:
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
CACHE_VERSION: v1
jobs:
build_on_windows:
name: Create/Upload Release Asset (Windows)
runs-on: windows-2022
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build project # This would actually build your project, using zip for an example artifact
run: echo 'SELECTED_COLOR=green Build project (Windows)' >> "$GITHUB_OUTPUT"
- name: Retrieve version
run: echo "TAG_NAME=$(git describe --abbrev=0 --tags)" >> "$GITHUB_OUTPUT"
id: version
#shell: pwsh
shell: bash
- name: Delete __Build folders
continue-on-error: false
run: if (Test-Path -Path ".\__build") { Remove-Item -Recurse -Force ".\__build" }
shell: pwsh
- name: Create __Build Folders
run: if (!(Test-Path -Path ".\__build")) { New-Item -ItemType Directory -Force -Path ".\__build" }
shell: pwsh
- name: Download tsc
continue-on-error: false
shell: pwsh
run: Invoke-WebRequest -SkipCertificateCheck -Uri "https://github.com/ASDAlexander77/TypeScriptCompiler/releases/download/v0.0-pre-alpha45/tsc.zip" -OutFile "tsc.zip"
- name: UnZip tsc
continue-on-error: false
run: if (Test-Path -Path "tsc.zip") { Expand-Archive -Path "tsc.zip" -DestinationPath "compiler\tsc" -Force }
shell: pwsh
- name: Build
continue-on-error: false
run: "& ./build.bat"
shell: pwsh
env:
TOOL_PATH: .\compiler\tsc
GC_LIB_PATH: .\compiler\tsc
LLVM_LIB_PATH: .\compiler\tsc
TSC_LIB_PATH: .\compiler\tsc
- name: Create Zip of Windows Asset
working-directory: ${{github.workspace}}/__build
run: Get-ChildItem -Path .\* | Compress-Archive -DestinationPath ..\defaultlib.zip
shell: pwsh
- name: Archive Zip of Windows Asset
uses: actions/upload-artifact@v4
with:
name: tsc-windows-defaultlib-asset
path: defaultlib.zip
retention-days: 1
build_on_linux:
name: Create/Upload Release Asset (Ubuntu 22.04)
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build project # This would actually build your project, using zip for an example artifact
run: echo 'SELECTED_COLOR=green Build project (Windows)' >> "$GITHUB_OUTPUT"
- name: Retrieve version
run: echo "TAG_NAME=$(git describe --abbrev=0 --tags)" >> "$GITHUB_OUTPUT"
id: version
shell: bash
- name: Delete __Build TS folders
continue-on-error: true
run: rm -R ./__build
shell: sh
- name: Create __Build Folders
run: mkdir -p ./__build
shell: sh
- name: Download tsc
continue-on-error: true
shell: sh
run: curl --insecure -L https://github.com/ASDAlexander77/TypeScriptCompiler/releases/download/v0.0-pre-alpha45/tsc.tar.gz --output tsc.tar.gz
- name: Create folder compiler/tsc
continue-on-error: false
shell: sh
run: mkdir -p ./compiler/tsc
- name: UnZip tsc
continue-on-error: false
shell: sh
run: tar -xvzf tsc.tar.gz -C ./compiler/tsc
- name: Build
continue-on-error: false
run: "./build.sh"
shell: bash
env:
TOOL_PATH: ./compiler/tsc
GC_LIB_PATH: ./compiler/tsc
LLVM_LIB_PATH: ./compiler/tsc
TSC_LIB_PATH: ./compiler/tsc
- name: Create Tar.GZ of Linux Asset
working-directory: ${{github.workspace}}/__build
shell: sh
run: tar -czvhf ../defaultlib.tar.gz ./*
- name: Archive Tar.GZ of Linux Asset
uses: actions/upload-artifact@v4
with:
name: tsc-linux-defaultlib-asset
path: defaultlib.tar.gz
retention-days: 1
build_on_linux_ub20:
name: Create/Upload Release Asset (Ubuntu 20.04)
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build project # This would actually build your project, using zip for an example artifact
run: echo 'SELECTED_COLOR=green Build project (Windows)' >> "$GITHUB_OUTPUT"
- name: Retrieve version
run: echo "TAG_NAME=$(git describe --abbrev=0 --tags)" >> "$GITHUB_OUTPUT"
id: version
shell: bash
- name: Delete __Build TS folders
continue-on-error: true
run: rm -R ./__build
shell: sh
- name: Create __Build Folders
run: mkdir -p ./__build
shell: sh
- name: Download tsc
continue-on-error: true
shell: sh
run: curl --insecure -L https://github.com/ASDAlexander77/TypeScriptCompiler/releases/download/v0.0-pre-alpha45/tsc.tar.gz --output tsc.tar.gz
- name: Create folder compiler/tsc
continue-on-error: false
shell: sh
run: mkdir -p ./compiler/tsc
- name: UnZip tsc
continue-on-error: false
shell: sh
run: tar -xvzf tsc.tar.gz -C ./compiler/tsc
- name: Build
continue-on-error: false
run: "./build.sh"
shell: bash
env:
TOOL_PATH: ./compiler/tsc
GC_LIB_PATH: ./compiler/tsc
LLVM_LIB_PATH: ./compiler/tsc
TSC_LIB_PATH: ./compiler/tsc
- name: Create Tar.GZ of Linux Asset
working-directory: ${{github.workspace}}/__build
shell: sh
run: tar -czvhf ../defaultlib-ub20.tar.gz ./*
- name: Archive Tar.GZ of Linux Asset
uses: actions/upload-artifact@v4
with:
name: tsc-linux-defaultlib-asset-ub20
path: defaultlib-ub20.tar.gz
retention-days: 1
create_release:
needs: [build_on_windows, build_on_linux, build_on_linux_ub20]
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: true
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
deploy_windows_asset:
needs: create_release
name: Upload Release (Windows)
runs-on: windows-latest
steps:
- name: Download Release Asset from Store
uses: actions/download-artifact@v4
with:
name: tsc-windows-defaultlib-asset
- name: Upload Release Asset (Windows)
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./defaultlib.zip
asset_name: defaultlib.zip
asset_content_type: application/zip
deploy_linux_asset:
needs: create_release
name: Upload Release (Ubuntu 22.04)
runs-on: ubuntu-latest
steps:
- name: Download Release Asset from Store
uses: actions/download-artifact@v4
with:
name: tsc-linux-defaultlib-asset
- name: Upload Release Asset (Ubuntu 22.04)
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./defaultlib.tar.gz
asset_name: defaultlib.tar.gz
asset_content_type: application/tar+gzip
deploy_linux_asset_ub20:
needs: create_release
name: Upload Release (Ubuntu 20.04)
runs-on: ubuntu-latest
steps:
- name: Download Release Asset from Store
uses: actions/download-artifact@v4
with:
name: tsc-linux-defaultlib-asset-ub20
- name: Upload Release Asset (Ubuntu 20.04)
id: upload-release-asset-ub20
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./defaultlib-ub20.tar.gz
asset_name: defaultlib-ub20.tar.gz
asset_content_type: application/tar+gzip