This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
88 lines (76 loc) · 3.14 KB
/
main.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
name: Package World of Warcraft addon
on:
workflow_dispatch:
inputs:
version:
description: 'Addon version'
required: true
env:
CLASSIC_VERSION: 11307
BURNING_CRUSADE_VERSION: 20501
CURSEFORGE_PROJECT_ID: 504674
WOWINTERFACE_PROJECT_ID: 26117
jobs:
package:
name: Create zips and tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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 --include '*.toc' --include '*.lua' --exclude '.*' --exclude '*' . .releases/${{steps.init.outputs.addon_name}}
- name: Create retail zip
run: |
cd .releases
zip -9 -r ${{steps.init.outputs.tag_name}}.zip ${{steps.init.outputs.addon_name}}
cd ..
- name: Create changelog
id: changelog
run: |
changelog_name=changelog-${{github.event.inputs.version}}.txt
git log $(git describe --tags --abbrev=0)..HEAD --oneline --pretty=%s > .releases/$changelog_name
echo "::set-output name=changelog_name::${changelog_name}"
- 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 retail 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: Upload zip to CurseForge
# run: |
# curl -s https://wow.curseforge.com/api/projects/${{ env.CURSEFORGE_PROJECT_ID }}/upload-file \
# -H 'X-Api-Token: ${{ secrets.CURSEFORGE_API_TOKEN }}' \
# -F [email protected]/${{ steps.init.outputs.tag_name }}.zip \
# -F metadata='{ "changelog": "${{github.event.inputs.version}}", "displayName": "${{ steps.init.outputs.tag_name }}.zip", "gameVersions": [8290], "releaseType": "release"}'
- name: Upload zip to WowInterface
if: success() || failure()
run: |
curl -s https://api.wowinterface.com/addons/update \
-H "x-api-token: ${{ secrets.WOWINTERFACE_API_TOKEN }}" \
-F id=${{ env.WOWINTERFACE_PROJECT_ID }} \
-F version=${{github.event.inputs.version}} \
-F [email protected]/${{ steps.init.outputs.tag_name }}.zip \
-F [email protected]/${{ steps.changelog.outputs.changelog_name }}