Skip to content

Commit

Permalink
Add publishing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisSpomer authored Feb 24, 2022
1 parent df310ec commit 680766f
Showing 1 changed file with 102 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/package-addon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Package World of Warcraft addon

on:
workflow_dispatch:
inputs:
version:
description: 'Addon version'
required: true

env:
CLASSIC_VERSION: 11402
BURNING_CRUSADE_VERSION: 20503

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 --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: 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: 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: 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

0 comments on commit 680766f

Please sign in to comment.