-
-
Notifications
You must be signed in to change notification settings - Fork 23
145 lines (123 loc) · 5.04 KB
/
package-addon.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
name: Package World of Warcraft addon
on:
workflow_dispatch:
inputs:
version:
description: 'Addon version'
required: true
env:
CLASSIC_VERSION: 11501
BURNING_CRUSADE_VERSION: 20504
WRATH_VERSION: 30403
CATACLYSM_VERSION: 40400
jobs:
package:
name: Create zips and tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get name of addon
id: init
run: |
addon_name=$(ls *.toc)
addon_name=$(basename $addon_name .toc)
tag_name=${addon_name}-${{github.event.inputs.version}}
echo "::set-output name=addon_name::${addon_name}"
echo "::set-output name=tag_name::${tag_name}"
- name: Make folder for zips
run: |
mkdir -p .releases/${{steps.init.outputs.addon_name}}
rsync -r --exclude '.*' . .releases/${{steps.init.outputs.addon_name}}
- name: Create mainline zip
run: |
cd .releases
zip -9 -r ${{steps.init.outputs.tag_name}}.zip ${{steps.init.outputs.addon_name}}
cd ..
- name: Replace TOC version for Classic
run: |
sed -i 's/Interface: *[0-9]\+/Interface: ${{env.CLASSIC_VERSION}}/g' .releases/${{steps.init.outputs.addon_name}}/${{steps.init.outputs.addon_name}}.toc
- name: Create Classic zip
run: |
cd .releases
zip -9 -r ${{steps.init.outputs.tag_name}}-Classic.zip ${{steps.init.outputs.addon_name}}
cd ..
- name: Replace TOC version for Burning Crusade
run: |
sed -i 's/Interface: *[0-9]\+/Interface: ${{env.BURNING_CRUSADE_VERSION}}/g' .releases/${{steps.init.outputs.addon_name}}/${{steps.init.outputs.addon_name}}.toc
- name: Create Burning Crusade zip
run: |
cd .releases
zip -9 -r ${{steps.init.outputs.tag_name}}-BurningCrusade.zip ${{steps.init.outputs.addon_name}}
cd ..
- name: Replace TOC version for Wrath
run: |
sed -i 's/Interface: *[0-9]\+/Interface: ${{env.WRATH_VERSION}}/g' .releases/${{steps.init.outputs.addon_name}}/${{steps.init.outputs.addon_name}}.toc
- name: Create Wrath zip
run: |
cd .releases
zip -9 -r ${{steps.init.outputs.tag_name}}-Wrath.zip ${{steps.init.outputs.addon_name}}
cd ..
- name: Replace TOC version for Cataclysm
run: |
sed -i 's/Interface: *[0-9]\+/Interface: ${{env.CATACLYSM_VERSION}}/g' .releases/${{steps.init.outputs.addon_name}}/${{steps.init.outputs.addon_name}}.toc
- name: Create Cataclysm zip
run: |
cd .releases
zip -9 -r ${{steps.init.outputs.tag_name}}-Cataclysm.zip ${{steps.init.outputs.addon_name}}
cd ..
- name: Tag this version
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{steps.init.outputs.tag_name}}
release_name: ${{steps.init.outputs.addon_name}} ${{github.event.inputs.version}}
body: ${{steps.init.outputs.addon_name}} ${{github.event.inputs.version}}
draft: false
prerelease: false
- name: Add mainline zip to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .releases/${{steps.init.outputs.tag_name}}.zip
asset_name: ${{steps.init.outputs.tag_name}}.zip
asset_content_type: application/zip
- name: Add Classic zip to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .releases/${{steps.init.outputs.tag_name}}-Classic.zip
asset_name: ${{steps.init.outputs.tag_name}}-Classic.zip
asset_content_type: application/zip
- name: Add Burning Crusade zip to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .releases/${{steps.init.outputs.tag_name}}-BurningCrusade.zip
asset_name: ${{steps.init.outputs.tag_name}}-BurningCrusade.zip
asset_content_type: application/zip
- name: Add Wrath zip to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .releases/${{steps.init.outputs.tag_name}}-Wrath.zip
asset_name: ${{steps.init.outputs.tag_name}}-Wrath.zip
asset_content_type: application/zip
- name: Add Cataclysm zip to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .releases/${{steps.init.outputs.tag_name}}-Cataclysm.zip
asset_name: ${{steps.init.outputs.tag_name}}-Cataclysm.zip
asset_content_type: application/zip