Skip to content

Commit

Permalink
Actions initial workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hythloday authored Jul 15, 2021
1 parent 80435e8 commit ab419d9
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Package World of Warcraft addon

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

env:
CLASSIC_VERSION: 11307
BURNING_CRUSADE_VERSION: 20501

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

0 comments on commit ab419d9

Please sign in to comment.