Release 2.10.7-beta1 #138
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Package World of Warcraft addon | |
run-name: Release ${{github.event.inputs.version}} | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Addon version' | |
required: true | |
env: | |
CLASSIC_VERSION: 11503 | |
BURNING_CRUSADE_VERSION: 20504 | |
WRATH_VERSION: 30403 | |
CATACLYSM_VERSION: 40401 | |
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 | |