-
Notifications
You must be signed in to change notification settings - Fork 16
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
1 changed file
with
68 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,68 @@ | ||
name: Release Creation | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
release: | ||
types: [published] | ||
env: | ||
MODULE_ID: dnd5e-spellpoints | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Get part of the tag after the `v`. | ||
- name: Extract tag version number | ||
id: get_version | ||
uses: battila7/get-version-action@v2 | ||
|
||
# Modify manifest version, download, esmodules, styles, remove hotreload. | ||
- name: Modify Manifest to remove HotReload | ||
uses: microsoft/variable-substitution@v1 | ||
with: | ||
files: "module.json" | ||
env: | ||
flags.hotReload: false | ||
version: ${{steps.get_version.outputs.version-without-v}} | ||
id: ${{env.MODULE_ID}} | ||
url: https://github.com/${{ github.repository }} | ||
download: https://github.com/${{ github.repository }}/releases/download/${{steps.get_version.outputs.version}}/${{env.MODULE_ID}}.zip | ||
manifest: https://github.com/${{ github.repository }}/releases/download/${{steps.get_version.outputs.version}}/module.json, | ||
|
||
# Create zip file. | ||
- name: Create ZIP archive | ||
run: zip -r ./live-play-tt.zip | ||
module.json | ||
README.md | ||
LICENSE | ||
CHANGELOG.md | ||
css/ | ||
|
||
# Get the release notes and set a convenient 'id' for accessing later | ||
- name: Read release notes and add to package | ||
uses: yashanand1910/[email protected] | ||
id: get_release_notes | ||
with: | ||
changelog_path: ./CHANGELOG.md # Optional | ||
version: ${{steps.get_version.outputs.version}} # Required | ||
|
||
# Create a release for this specific version. | ||
- name: Update Release with Files | ||
if: '!github.event.release.prerelease' | ||
id: create_version_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
name: ${{ github.event.release.name }} | ||
draft: false | ||
prerelease: false | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
artifacts: "./module.json, ./live-play-tt.zip" | ||
tag: ${{ github.event.release.tag_name }} | ||
body: ${{ steps.get_release_notes.outputs.release_notes }} |