✅ Ready to clone and code.
This commit is contained in:
		
				
					committed by
					
						
						github-actions[bot]
					
				
			
			
				
	
			
			
			
						parent
						
							c9a9b12831
						
					
				
				
					commit
					a49ea792cc
				
			@@ -86,8 +86,8 @@ start() {
 | 
			
		||||
        echo "New version: $new_version"
 | 
			
		||||
 | 
			
		||||
        gitchangelog | grep -v "[rR]elease:" > HISTORY.md
 | 
			
		||||
        git add project_name/VERSION HISTORY.md
 | 
			
		||||
        echo $new_version > project_name/VERSION
 | 
			
		||||
        git add song_of_the_day/VERSION HISTORY.md
 | 
			
		||||
        echo $new_version > song_of_the_day/VERSION
 | 
			
		||||
        git commit -m "release: version $new_version 🚀"
 | 
			
		||||
        echo "creating git tag : $new_version"
 | 
			
		||||
        git tag $new_version
 | 
			
		||||
 
 | 
			
		||||
@@ -1,42 +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
 | 
			
		||||
mv project_name.Tests $name.Tests
 | 
			
		||||
mv project_name.sln $name.sln
 | 
			
		||||
mv $name/project_name.csproj $name/$name.csproj
 | 
			
		||||
mv $name.Tests/project_name.Tests.csproj $name.Tests/$name.Tests.csproj
 | 
			
		||||
 | 
			
		||||
# 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
 | 
			
		||||
@@ -59,6 +59,6 @@ jobs:
 | 
			
		||||
    #     REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}')
 | 
			
		||||
    #     REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')
 | 
			
		||||
    #     dotnet nuget add source --name gitea --username $GITEA_USERNAME --password $GITEA_PASSWORD https://git.disi.dev/api/packages/$REPOSITORY_OWNER/nuget/index.json      
 | 
			
		||||
    #     dotnet pack --include-symbols --include-source -p:PackageVersion=$(cat $REPOSITORY_NAME/VERSION) project_name.sln
 | 
			
		||||
    #     dotnet pack --include-symbols --include-source -p:PackageVersion=$(cat $REPOSITORY_NAME/VERSION) song_of_the_day.sln
 | 
			
		||||
    #     dotnet nuget push --source gitea $REPOSITORY_NAME/bin/Release/$REPOSITORY_NAME.$(cat $REPOSITORY_NAME/VERSION).nupkg
 | 
			
		||||
    #     dotnet nuget push --source gitea $REPOSITORY_NAME/bin/Release/$REPOSITORY_NAME.$(cat $REPOSITORY_NAME/VERSION).symbols.nupkg
 | 
			
		||||
 
 | 
			
		||||
@@ -1,48 +0,0 @@
 | 
			
		||||
name: Rename the project from template
 | 
			
		||||
 | 
			
		||||
on: [push]
 | 
			
		||||
 | 
			
		||||
permissions: write-all
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  rename-project:
 | 
			
		||||
    if: ${{ !endsWith (gitea.repository, 'Templates/Dotnet_Executable') }}
 | 
			
		||||
    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
 | 
			
		||||
@@ -10,7 +10,7 @@ jobs:
 | 
			
		||||
  sonarqube:
 | 
			
		||||
    name: SonarQube Trigger
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    if: ${{ !contains ('project_name', format('{0}_{1}', 'project', 'name')) }}
 | 
			
		||||
    if: ${{ !contains ('song_of_the_day', format('{0}_{1}', 'project', 'name')) }}
 | 
			
		||||
    steps:
 | 
			
		||||
    - name: Checking out
 | 
			
		||||
      uses: actions/checkout@v4
 | 
			
		||||
@@ -24,4 +24,4 @@ jobs:
 | 
			
		||||
        SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
 | 
			
		||||
      with:
 | 
			
		||||
        args: >
 | 
			
		||||
          -Dsonar.projectKey=project_name
 | 
			
		||||
          -Dsonar.projectKey=song_of_the_day
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
# How to develop on this project
 | 
			
		||||
 | 
			
		||||
project_name welcomes contributions from the community.
 | 
			
		||||
song_of_the_day welcomes contributions from the community.
 | 
			
		||||
 | 
			
		||||
**You need Dotnet 9!**
 | 
			
		||||
 | 
			
		||||
@@ -8,9 +8,9 @@ This instructions are for linux base systems. (Linux, MacOS, BSD, etc.)
 | 
			
		||||
## Setting up your own fork of this repo.
 | 
			
		||||
 | 
			
		||||
- On gitea interface click on `Fork` button.
 | 
			
		||||
- Clone your fork of this repo. `git clone git@git.disi.dev:YOUR_GIT_USERNAME/project_urlname.git`
 | 
			
		||||
- Enter the directory `cd project_urlname`
 | 
			
		||||
- Add upstream repo `git remote add upstream https://git.disi.dev/author_name/project_urlname`
 | 
			
		||||
- Clone your fork of this repo. `git clone git@git.disi.dev:YOUR_GIT_USERNAME/song-of-the-day.git`
 | 
			
		||||
- Enter the directory `cd song-of-the-day`
 | 
			
		||||
- Add upstream repo `git remote add upstream https://git.disi.dev/HomeLab/song-of-the-day`
 | 
			
		||||
 | 
			
		||||
## Run the tests to ensure everything is working
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
FROM mcr.microsoft.com/dotnet/runtime:9.0
 | 
			
		||||
COPY ./project_name/bin/Release/net9.0/ /app
 | 
			
		||||
COPY ./song_of_the_day/bin/Release/net9.0/ /app
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
CMD ["project_name"]
 | 
			
		||||
CMD ["song_of_the_day"]
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 | 
			
		||||
# Visual Studio Version 17
 | 
			
		||||
VisualStudioVersion = 17.5.002.0
 | 
			
		||||
MinimumVisualStudioVersion = 10.0.40219.1
 | 
			
		||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "project_name", "project_name\project_name.csproj", "{10631217-F1DA-4589-AED7-6E7A777AA031}"
 | 
			
		||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "song_of_the_day", "song_of_the_day\song_of_the_day.csproj", "{10631217-F1DA-4589-AED7-6E7A777AA031}"
 | 
			
		||||
EndProject
 | 
			
		||||
Global
 | 
			
		||||
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 | 
			
		||||
 
 | 
			
		||||
@@ -2,4 +2,4 @@ include LICENSE
 | 
			
		||||
include HISTORY.md
 | 
			
		||||
include Containerfile
 | 
			
		||||
graft tests
 | 
			
		||||
graft project_name
 | 
			
		||||
graft song_of_the_day
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								Makefile
									
									
									
									
									
								
							@@ -17,31 +17,31 @@ help:             ## Show the help.
 | 
			
		||||
 | 
			
		||||
.PHONY: buildrel
 | 
			
		||||
buildrel: issetup             ## Format code.
 | 
			
		||||
	dotnet build -c Release project_name.sln
 | 
			
		||||
	dotnet build -c Release song_of_the_day.sln
 | 
			
		||||
 | 
			
		||||
.PHONY: build
 | 
			
		||||
build: issetup             ## Format code.
 | 
			
		||||
	dotnet build project_name.sln
 | 
			
		||||
	dotnet build song_of_the_day.sln
 | 
			
		||||
 | 
			
		||||
.PHONY: publish
 | 
			
		||||
publish: issetup             ## Format code.
 | 
			
		||||
	dotnet publish -c Release project_name.sln
 | 
			
		||||
	dotnet publish -c Release song_of_the_day.sln
 | 
			
		||||
 | 
			
		||||
.PHONY: fmt
 | 
			
		||||
fmt: issetup             ## Format code.
 | 
			
		||||
	dotnet format project_name.sln
 | 
			
		||||
	dotnet format song_of_the_day.sln
 | 
			
		||||
 | 
			
		||||
.PHONY: lint
 | 
			
		||||
lint: issetup            ## Lint code.
 | 
			
		||||
	dotnet format --verify-no-changes --verbosity diagnostic project_name.sln
 | 
			
		||||
	dotnet format --verify-no-changes --verbosity diagnostic song_of_the_day.sln
 | 
			
		||||
 | 
			
		||||
.PHONY: test
 | 
			
		||||
test: issetup            ## Run tests and generate coverage report.
 | 
			
		||||
	dotnet test project_name.sln
 | 
			
		||||
	dotnet test song_of_the_day.sln
 | 
			
		||||
 | 
			
		||||
.PHONY: clean
 | 
			
		||||
clean: issetup           ## Clean unused files.
 | 
			
		||||
	dotnet clean project_name.sln
 | 
			
		||||
	dotnet clean song_of_the_day.sln
 | 
			
		||||
 | 
			
		||||
.PHONY: release
 | 
			
		||||
release: issetup         ## Create a new tag for release.
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
# project_name
 | 
			
		||||
# song_of_the_day
 | 
			
		||||
 | 
			
		||||
project_description
 | 
			
		||||
Awesome song_of_the_day created by HomeLab
 | 
			
		||||
 | 
			
		||||
## Usage
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,2 +1,2 @@
 | 
			
		||||
site_name: project_name
 | 
			
		||||
site_name: song_of_the_day
 | 
			
		||||
theme: readthedocs
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
namespace project_name.Tests;
 | 
			
		||||
namespace song_of_the_day.Tests;
 | 
			
		||||
 | 
			
		||||
using  project_name;
 | 
			
		||||
using  song_of_the_day;
 | 
			
		||||
 | 
			
		||||
public class UnitTest1
 | 
			
		||||
{
 | 
			
		||||
@@ -9,7 +9,7 @@
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <ProjectReference Include="../project_name/project_name.csproj" />
 | 
			
		||||
    <ProjectReference Include="../song_of_the_day/song_of_the_day.csproj" />
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
@@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 | 
			
		||||
# Visual Studio Version 17
 | 
			
		||||
VisualStudioVersion = 17.0.31903.59
 | 
			
		||||
MinimumVisualStudioVersion = 10.0.40219.1
 | 
			
		||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "project_name", "project_name\project_name.csproj", "{B25F5E39-D0A6-4548-A3B6-428275AB154D}"
 | 
			
		||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "song_of_the_day", "song_of_the_day\song_of_the_day.csproj", "{B25F5E39-D0A6-4548-A3B6-428275AB154D}"
 | 
			
		||||
EndProject
 | 
			
		||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "project_name.Tests", "project_name.Tests\project_name.Tests.csproj", "{FD1B8A2E-3BA7-4FDD-96FB-18551A15A5F3}"
 | 
			
		||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "song_of_the_day.Tests", "song_of_the_day.Tests\song_of_the_day.Tests.csproj", "{FD1B8A2E-3BA7-4FDD-96FB-18551A15A5F3}"
 | 
			
		||||
EndProject
 | 
			
		||||
Global
 | 
			
		||||
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 | 
			
		||||
		Reference in New Issue
	
	Block a user