Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
haouarihk authored Jan 12, 2024
0 parents commit 5718734
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Release

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Extract version from commit message
id: ver
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
echo "Commit message: $COMMIT_MESSAGE"
if [[ $COMMIT_MESSAGE =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "version=$COMMIT_MESSAGE" >> $GITHUB_OUTPUT
else
echo "exit no version x.x.x in the commit message"
exit 1
fi
# Remove existing data.json file
- name: Remove data.json
run: rm -f data.json

# Get a list of all the files in the prompts folder
- name: Get list of prompts
run: ls prompts > prompts.txt

# Remove the file extension from each file name
- name: Remove file extensions
run: sed -i 's/\..*$//' prompts.txt

- name: Create data.json
run: |
# Add double quotes around each line
sed -i 's/^/"/' prompts.txt
sed -i 's/$/"/' prompts.txt
# Add comma at the end of each line except the last one
sed -i '$!s/$/,/' prompts.txt
# Create the JSON file
echo "{\"prompts\": [$(cat prompts.txt)]}" > data.json
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.ver.outputs.version }}
release_name: ${{ steps.ver.outputs.version }}
draft: false
prerelease: false
- name: Attach data.json
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: data.json
asset_name: data.json
asset_content_type: application/json
- name: Attach manifest.json
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: manifest.json
asset_name: manifest.json
asset_content_type: application/json
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 nhaouari

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Template's Package Template
This is a template repo to facilitate the creation of new template packages for Text generator Plugin.
# [How to create Templates package](https://text-gen.com/share-a-new-template-package)
11 changes: 11 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"packageId": "Put_Package_Id_Here",
"name": "Name of your package",
"version": "0.0.1",
"minTextGeneratorVersion": "0.1.0",
"description": "The description of the content of this package",
"author": "Your name",
"tags": "writing, brainstorming",
"authorUrl": "Support URL",
"repo": "username/repo"
}
14 changes: 14 additions & 0 deletions prompts/getExample.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
promptId: getExample
name: ✉️ Emoji + Short description
description: longer description
author: author Name
tags: tag1, tag2
required_values: val1, val2
version: 0.0.1
---
content:
{{context}}
prompt:
Write an example about content
example:

0 comments on commit 5718734

Please sign in to comment.