Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
misthero authored Sep 20, 2024
1 parent cd3c540 commit 2bd7247
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/main.yml
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 }}

0 comments on commit 2bd7247

Please sign in to comment.