-
Notifications
You must be signed in to change notification settings - Fork 33
212 lines (188 loc) · 7.15 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
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
name: Create Release
on:
workflow_dispatch:
jobs:
build-and-publish:
runs-on: windows-latest
permissions:
actions: read
contents: write
deployments: none
packages: none
pull-requests: none
security-events: none
checks: none
id-token: none
issues: none
repository-projects: none
statuses: none
steps:
- uses: actions/checkout@v4
- name: Bump version
id: version
uses: vemel/[email protected]
with:
path: ./ts-starter/package.json
type: semver
result: ${{ github.event.inputs.bump }}
release: ${{ github.event.inputs.release }}
update: |
./build-challenge/package.json
./custom-components/package.json
./editor-basics/package.json
./editor-script-box/package.json
./howto-gallery/package.json
./script-box/package.json
./ts-starter/package.json
./ts-starter-complete-cotta/package.json
- name: build-challenge Build
run: |
pushd build-challenge
npm ci
npm run mcaddon
popd
- name: custom-components Build
run: |
pushd custom-components
npm ci
npm run mcaddon
popd
- name: editor-basics Build
run: |
pushd editor-basics
npm ci
npm run mcaddon
popd
- name: editor-script-box Build
run: |
pushd editor-basics
npm ci
npm run mcaddon
popd
- name: howto-gallery Build
run: |
pushd howto-galler
npm ci
npm run mcaddon
popd
- name: script-box Build
run: |
pushd script-box
npm ci
npm run mcaddon
popd
- name: ts-starter Build
run: |
pushd ts-starter
npm ci
npm run mcaddon
popd
- name: ts-starter-complete-cotta Build
run: |
pushd ts-starter-complete-cotta
npm ci
npm run mcaddon
popd
- name: Get Package Version
id: get-package-version
with:
path: build-challenge/
uses: stevenbenitez/get-package-version-action@v1
- name: Create draft Minecraft Scripting Samples release
id: create_samples_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.get-package-version.outputs.version }}-alpha
release_name: Minecraft Scripting Samples
draft: true
prerelease: true
- name: Upload build-challenge.mcaddon to node_module release
id: upload-build-challenge
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_samples_release.outputs.upload_url }}
asset_path: ./build-challenge/packages/buildchallenge.mcaddon
asset_name: build-challenge-v${{ steps.get-package-version.outputs.version }}.mcaddon
asset_content_type: application/zip
- name: Upload custom-components.mcaddon to node_module release
id: upload-custom-components
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_samples_release.outputs.upload_url }}
asset_path: ./custom-components/packages/custom_components.mcaddon
asset_name: custom-components-v${{ steps.get-package-version.outputs.version }}.mcaddon
asset_content_type: application/zip
- name: Upload editor-basics.mcaddon to node_module release
id: upload-editor-basics
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_samples_release.outputs.upload_url }}
asset_path: ./editor-basics/packages/editor-basics.mcaddon
asset_name: editor-basics-v${{ steps.get-package-version.outputs.version }}.mcaddon
asset_content_type: application/zip
- name: Upload editor-script-box.mcaddon to node_module release
id: upload-editor-script-box
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_samples_release.outputs.upload_url }}
asset_path: ./editor-script-box/packages/editor-script-box.mcaddon
asset_name: editor-script-box-v${{ steps.get-package-version.outputs.version }}.mcaddon
asset_content_type: application/zip
- name: Upload howto-gallery.mcaddon to node_module release
id: upload-howto-gallery
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_samples_release.outputs.upload_url }}
asset_path: ./howto-gallery/packages/howto-gallery.mcaddon
asset_name: howto-gallery-v${{ steps.get-package-version.outputs.version }}.mcaddon
asset_content_type: application/zip
- name: Upload script-box.mcaddon to node_module release
id: upload-script-box
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_samples_release.outputs.upload_url }}
asset_path: ./script-box/packages/script-box.mcaddon
asset_name: script-box-v${{ steps.get-package-version.outputs.version }}.mcaddon
asset_content_type: application/zip
- name: Upload ts-starter.mcaddon to node_module release
id: upload-ts-starter
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_samples_release.outputs.upload_url }}
asset_path: ./ts-starter/packages/ts-starter.mcaddon
asset_name: starter-v${{ steps.get-package-version.outputs.version }}.mcaddon
asset_content_type: application/zip
- name: Upload ts-starter-complete-cotta.mcaddon to node_module release
id: upload-ts-starter-complete-cotta
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_samples_release.outputs.upload_url }}
asset_path: ./ts-starter-complete-cotta/packages/cotta.mcaddon
asset_name: cotta-v${{ steps.get-package-version.outputs.version }}.mcaddon
asset_content_type: application/zip
- name: Commit version changes
run: |
VERSION=${{ toJSON(steps.version.outputs.result) }}
BRANCH="main"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -am "Bump version to $VERSION"
git push origin $BRANCH