-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
changelog: | ||
categories: | ||
- title: Changes | ||
labels: | ||
- '*' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
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 | ||
needs: build | ||
permissions: | ||
contents: write | ||
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 |