generated from Templates/Docker_Image
✅ Ready to clone and code.
This commit is contained in:
committed by
github-actions[bot]
parent
2410173af1
commit
d488434323
@@ -86,8 +86,8 @@ start() {
|
||||
echo "New version: $new_version"
|
||||
|
||||
gitchangelog | grep -v "[rR]elease:" > HISTORY.md
|
||||
echo $new_version > project_name/VERSION
|
||||
git add project_name/VERSION HISTORY.md
|
||||
echo $new_version > n8n_ollama/VERSION
|
||||
git add n8n_ollama/VERSION HISTORY.md
|
||||
git commit -m "release: version $new_version 🚀"
|
||||
echo "creating git tag : $new_version"
|
||||
git tag $new_version
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
while getopts a:n:u:d: flag
|
||||
do
|
||||
case "${flag}" in
|
||||
a) author=${OPTARG};;
|
||||
n) name=${OPTARG};;
|
||||
u) urlname=${OPTARG};;
|
||||
d) description=${OPTARG};;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "Author: $author";
|
||||
echo "Project Name: $name";
|
||||
echo "Project URL name: $urlname";
|
||||
echo "Description: $description";
|
||||
|
||||
echo "Renaming project..."
|
||||
|
||||
original_author="author_name"
|
||||
original_name="project_name"
|
||||
original_urlname="project_urlname"
|
||||
original_description="project_description"
|
||||
# for filename in $(find . -name "*.*")
|
||||
for filename in $(git ls-files)
|
||||
do
|
||||
sed -i "s/$original_author/$author/g" $filename
|
||||
sed -i "s/$original_name/$name/g" $filename
|
||||
sed -i "s/$original_urlname/$urlname/g" $filename
|
||||
sed -i "s/$original_description/$description/g" $filename
|
||||
echo "Renamed $filename"
|
||||
done
|
||||
|
||||
mv project_name $name
|
||||
|
||||
# This command runs only once on GHA!
|
||||
rm -rf .gitea/template.yml
|
||||
rm -rf project_name
|
||||
rm -rf project_name.Tests
|
||||
@@ -1 +0,0 @@
|
||||
author: rochacbruno
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
- name: Check version match
|
||||
run: |
|
||||
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')
|
||||
if [ "$(cat project_name/VERSION)" = "${GITHUB_REF_NAME}" ] ; then
|
||||
if [ "$(cat n8n_ollama/VERSION)" = "${GITHUB_REF_NAME}" ] ; then
|
||||
echo "Version matches successfully!"
|
||||
else
|
||||
echo "Version must match!"
|
||||
@@ -57,5 +57,5 @@ jobs:
|
||||
run: |
|
||||
REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}' | tr '[:upper:]' '[:lower:]')
|
||||
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')
|
||||
docker build -t "git.disi.dev/$REPOSITORY_OWNER/project_name:$(cat project_name/VERSION)" -f Containerfile ./
|
||||
docker push "git.disi.dev/$REPOSITORY_OWNER/project_name:$(cat project_name/VERSION)"
|
||||
docker build -t "git.disi.dev/$REPOSITORY_OWNER/n8n_ollama:$(cat n8n_ollama/VERSION)" -f Containerfile ./
|
||||
docker push "git.disi.dev/$REPOSITORY_OWNER/n8n_ollama:$(cat n8n_ollama/VERSION)"
|
||||
@@ -1,48 +0,0 @@
|
||||
name: Rename the project from template
|
||||
|
||||
on: [push]
|
||||
|
||||
permissions: write-all
|
||||
|
||||
jobs:
|
||||
rename-project:
|
||||
if: ${{ !endsWith (gitea.repository, 'Templates/Docker_Image') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
# by default, it uses a depth of 1
|
||||
# this fetches all history so that we can read each commit
|
||||
fetch-depth: 0
|
||||
ref: ${{ gitea.head_ref }}
|
||||
|
||||
- run: echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- run: echo "REPOSITORY_URLNAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}')" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- run: echo "REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}')" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Is this still a template
|
||||
id: is_template
|
||||
run: echo "::set-output name=is_template::$(ls .gitea/template.yml &> /dev/null && echo true || echo false)"
|
||||
|
||||
- name: Rename the project
|
||||
if: steps.is_template.outputs.is_template == 'true'
|
||||
run: |
|
||||
echo "Renaming the project with -a(author) ${{ env.REPOSITORY_OWNER }} -n(name) ${{ env.REPOSITORY_NAME }} -u(urlname) ${{ env.REPOSITORY_URLNAME }}"
|
||||
.gitea/rename_project.sh -a ${{ env.REPOSITORY_OWNER }} -n ${{ env.REPOSITORY_NAME }} -u ${{ env.REPOSITORY_URLNAME }} -d "Awesome ${{ env.REPOSITORY_NAME }} created by ${{ env.REPOSITORY_OWNER }}"
|
||||
|
||||
- name: Remove renaming workflow
|
||||
if: steps.is_template.outputs.is_template == 'true'
|
||||
run: |
|
||||
rm .gitea/workflows/rename_project.yml
|
||||
rm .gitea/rename_project.sh
|
||||
|
||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: "✅ Ready to clone and code."
|
||||
# commit_options: '--amend --no-edit'
|
||||
push_options: --force
|
||||
Reference in New Issue
Block a user