Skip to content

Commit

Permalink
release player addon github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrthinger committed Dec 9, 2023
1 parent 1b714f2 commit 779462d
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
categories:
- title: Changes
labels:
- '*'
99 changes: 99 additions & 0 deletions .github/workflows/release-player.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Release

on:
push:
branches:
- master
workflow_dispatch:


jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Rename TOC files
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION=${VERSION:1}
find ./AI_VoiceOver -name "*.toc" -exec sed -i "s/## Version: 0.0.0/## Version: $VERSION/g" {} \;
- name: Copy AI_VoiceOver to release
run: |
mkdir -p ./release
cp -r ./AI_VoiceOver ./release/vanilla
cp -r ./AI_VoiceOver ./release/tbc
cp -r ./AI_VoiceOver ./release/wrath
cp -r ./AI_VoiceOver ./release/blizz
- name: Copy TOC files
run: |
cp ./release/vanilla/AI_VoiceOver_1.12.toc ./release/vanilla/AI_VoiceOver.toc
cp ./release/tbc/AI_VoiceOver_2.4.3.toc ./release/tbc/AI_VoiceOver.toc
cp ./release/wrath/AI_VoiceOver_3.3.5.toc ./release/wrath/AI_VoiceOver.toc
cp ./release/blizz/AI_VoiceOver_Mainline.toc ./release/blizz/AI_VoiceOver.toc
- name: Zip each release version
run: |
cd ./release/vanilla && zip -r ../vanilla.zip . && cd ../..
cd ./release/tbc && zip -r ../tbc.zip . && cd ../..
cd ./release/wrath && zip -r ../wrath.zip . && cd ../..
cd ./release/blizz && zip -r ../blizz.zip . && cd ../..
- name: Confirm zips exist
run: |
if [ ! -f ./release/blizz.zip ] || [ ! -f ./release/tbc.zip ] || [ ! -f ./release/vanilla.zip ] || [ ! -f ./release/wrath.zip ]; then
echo "Error: One or more zip files do not exist."
echo "Expected: ./release/blizz.zip ./release/tbc.zip ./release/vanilla.zip ./release/wrath.zip"
echo "Actual: $(ls ./release/*.zip)"
exit 1
fi
release:
runs-on: ubuntu-latest
steps:
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./release/blizz.zip
./release/tbc.zip
./release/vanilla.zip
./release/wrath.zip
# - name: Upload Release Asset
# id: upload_release_asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./path/to/your/artifact
# asset_name: artifact-name
# asset_content_type: application/zip

# - name: Generate release notes
# id: generate_notes
# run: |
# echo "## Download" > release_notes.md
# echo "" >> release_notes.md
# echo "### Players" >> release_notes.md
# echo "| Addon Version | GitHub Direct Link | Curse Link |" >> release_notes.md
# echo "| ----- | ------------------ | ---------- |" >> release_notes.md
# echo "| Blizzard Classic (Vanilla & WotLK) | [GitHub ZIP Download](${{ steps.upload_release_asset.outputs.browser_download_url }}) | [Curse](https://www.curseforge.com/wow/addons/voiceover) |" >> release_notes.md
# # Add more lines as needed

# - name: Update release
# uses: actions/github-script@v3
# with:
# github-token: ${{secrets.GITHUB_TOKEN}}
# script: |
# const fs = require('fs');
# const release_notes = fs.readFileSync('release_notes.md', 'utf8');
# github.repos.updateRelease({
# owner: context.repo.owner,
# repo: context.repo.repo,
# release_id: ${{ steps.create_release.outputs.id }},
# body: release_notes

0 comments on commit 779462d

Please sign in to comment.