Create Module Files For GitHub Release #24
Workflow file for this run
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: Create Module Files For GitHub Release | |
env: | |
project_url: "https://github.com/${{github.repository}}" | |
latest_manifest_url: "https://github.com/${{github.repository}}/releases/latest/download/module.json" | |
release_module_url: "https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip" | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Extract Version From Tag | |
id: get_version | |
uses: battila7/[email protected] | |
- name: Modify Module Manifest With Release-Specific Values | |
id: sub_manifest_link_version | |
uses: cschleiden/[email protected] | |
with: | |
files: 'module.json' | |
env: | |
VERSION: ${{steps.get_version.outputs.version-without-v}} | |
URL: ${{ env.project_url }} | |
MANIFEST: ${{ env.latest_manifest_url }} | |
DOWNLOAD: ${{ env.release_module_url }} | |
- name: Downloading Dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Create Module Archive | |
run: | | |
zip \ | |
--recurse-paths \ | |
./module.zip \ | |
module.json \ | |
README.md \ | |
LICENSE \ | |
templates \ | |
dist/ \ | |
styles/ \ | |
packs/ \ | |
languages/ | |
- name: Update Release With Files | |
id: create_version_release | |
uses: ncipollo/[email protected] | |
with: | |
allowUpdates: true | |
name: ${{ github.event.release.name }} | |
draft: ${{ github.event.release.unpublished }} | |
prerelease: ${{ github.event.release.prerelease }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: './module.json, ./module.zip' | |
tag: ${{ github.event.release.tag_name }} | |
body: ${{ github.event.release.body }} |