51 lines
No EOL
1.8 KiB
YAML
51 lines
No EOL
1.8 KiB
YAML
name: Create Draft Release
|
|
on: [workflow_dispatch]
|
|
jobs:
|
|
everything:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# Checkout the repository
|
|
- uses: actions/checkout@v4
|
|
|
|
# Install node and NPM
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "19"
|
|
|
|
# Install required packages
|
|
- run: npm install
|
|
|
|
- name: Reading the system.json for the version
|
|
id: "version"
|
|
run: cat system.json | echo version=`jq -r ".version"` >> "$GITHUB_OUTPUT"
|
|
|
|
# Check that tag doesn't exist
|
|
- uses: mukunku/tag-exists-action@v1.5.0
|
|
id: check-tag
|
|
with:
|
|
tag: "v${{ steps.version.outputs.version }}"
|
|
|
|
- name: "Ensure that the tag doesn't exist"
|
|
if: ${{ steps.check-tag.outputs.exists == 'true' }}
|
|
run: exit 1
|
|
|
|
- name: Move system.json to a temp file
|
|
id: manifest-move
|
|
run: mv system.json module.temp.json
|
|
|
|
- name: Update the download property in the manifest
|
|
id: manifest-update
|
|
run: cat module.temp.json | jq -r --tab '.download = "https://github.com/${{ github.repository }}/releases/download/v${{ steps.version.outputs.version }}/release.zip"' > system.json
|
|
|
|
- name: Create the zip
|
|
run: zip -r release.zip system.json module langs assets templates README.md
|
|
|
|
- name: Create the draft release
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
tag: "v${{ steps.version.outputs.version }}"
|
|
commit: ${{ github.ref }}
|
|
draft: true
|
|
body: <img aria-hidden="true" src="https://img.shields.io/github/downloads/${{ github.repository }}/v${{ steps.version.outputs.version }}/release.zip?style=flat-square&color=%2300aa00">
|
|
generateReleaseNotes: true
|
|
artifacts: "release.zip,system.json" |