0.5.17 #347
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: Module Builder | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'README.md' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
release-notes: ${{ steps.set-release-notes.outputs.release-notes }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Release Notes for Github | |
id: set-release-notes-github | |
run: | | |
echo "- General:" >> release_notes.txt | |
echo " - Dependencies: Updated Bugbears Scripts to reference an existing manifest, unsure why the previous one was removed." >> release_notes.txt | |
echo "- Additions:" >> release_notes.txt | |
echo " - Runic Shield: Automation for the Rune Knights Runic Shield feature" >> release_notes.txt | |
echo " - Mage Slayer: Automation for the feat Mage Slayer" >> release_notes.txt | |
echo " - Entropic Ward: Automation for the Warlocks Entropic Ward feature" >> release_notes.txt | |
echo "- Updates:" >> release_notes.txt | |
echo " - Ball Bearings: Modify item lookup to allow changing the name of the item." >> release_notes.txt | |
echo " - Black Tentacles: Modify item lookup to allow changing the name of the item." >> release_notes.txt | |
echo " - Caltrops: Modify item lookup to allow changing the name of the item." >> release_notes.txt | |
echo " - Cloud of Daggers: Modify item lookup to allow changing the name of the item." >> release_notes.txt | |
echo "- Bugfixes:" >> release_notes.txt | |
echo " - Cutting Words: Prevent Healing from initiating the workflow." >> release_notes.txt | |
echo " - Interception: Prevent Healing from initiating the workflow." >> release_notes.txt | |
echo "release-notes-github<<EOF" >> $GITHUB_ENV | |
cat release_notes.txt >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Format Release Notes for Discord | |
id: format-release-notes-discord | |
run: | | |
DISCORD_NOTES=$(awk '{printf "%s\\n", $0}' release_notes.txt | sed 's/\\n$//') | |
echo "::set-output name=release-notes-discord::$DISCORD_NOTES" | |
- name: Get Version from Commit Message | |
id: get-version | |
run: | | |
version=$(git log -1 --pretty=%B | grep -o -E '[v]?[0-9]+\.[0-9]+\.[0-9]+' | sed 's/^v//') | |
echo "version=$version" >> $GITHUB_OUTPUT | |
echo "Extracted version: $version" | |
- name: Update module.json with Version | |
run: node update-module.js ${{ steps.get-version.outputs.version }} | |
- name: Zip Files | |
working-directory: ./ | |
run: zip -r ./module.zip ./* | |
- name: Create Release | |
id: create-release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
name: Release ${{ steps.get-version.outputs.version }} | |
draft: false | |
prerelease: false | |
body: ${{ env.release-notes-github }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: './module.zip, ./module.json' | |
tag: ${{ steps.get-version.outputs.version }} | |
- name: Release Foundry Package | |
run: | | |
curl -X POST "https://api.foundryvtt.com/_api/packages/release_version" \ | |
-H "Content-Type: application/json" \ | |
-H "Authorization: ${{ secrets.FOUNDRY_API_TOKEN }}" \ | |
-d '{ | |
"id": "'"gambits-premades"'", | |
"release": { | |
"version": "'"${{ steps.get-version.outputs.version }}"'", | |
"manifest": "'"https://github.com/gambit07/gambits-premades/releases/download/${{ steps.get-version.outputs.version }}/module.json"'", | |
"notes": "'"https://github.com/gambit07/gambits-premades/releases/tag/${{ steps.get-version.outputs.version }}"'", | |
"compatibility": { | |
"minimum": "'"12.328"'", | |
"verified": "'"12"'", | |
"maximum": "'"12"'" | |
} | |
} | |
}' | |
- name: Post to Discord | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_MIDI_WEBHOOK }} | |
run: | | |
curl -H "Content-Type: application/json" \ | |
-d '{ | |
"embeds": [{ | |
"title": "Gambit'"'"'s Premades Release: ${{ steps.get-version.outputs.version }}", | |
"description": "**To support my continued work on this module!\n<https://ko-fi.com/gambit07> ❤️**\n\n${{ steps.format-release-notes-discord.outputs.release-notes-discord }}\n\nCheck it out through the Foundry package manager or the link below:\n<https://github.com/gambit07/gambits-premades/releases/tag/${{ steps.get-version.outputs.version }}>", | |
"image": { | |
"url": "https://avatars.githubusercontent.com/u/4236874?s=400&u=05d3718580ef87ea13467131a0c1fcaf4956630d&v=4" | |
} | |
}] | |
}' $DISCORD_WEBHOOK |