This commit is contained in:
2024-11-27 19:20:16 +01:00
parent 302e0f64a2
commit a6bae9dc80
8 changed files with 23 additions and 16 deletions

View File

@@ -31,6 +31,10 @@ do
done done
mv project_name $name 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! # This command runs only once on GHA!
rm -rf .gitea/template.yml rm -rf .gitea/template.yml

View File

@@ -26,8 +26,6 @@ jobs:
- uses: actions/setup-dotnet@v4 - uses: actions/setup-dotnet@v4
with: with:
dotnet-version: ${{ matrix.dotnet-version }} dotnet-version: ${{ matrix.dotnet-version }}
- name: Install project
run: make install
- name: Run linter - name: Run linter
run: make lint run: make lint
@@ -44,8 +42,6 @@ jobs:
- uses: actions/setup-dotnet@v4 - uses: actions/setup-dotnet@v4
with: with:
dotnet-version: ${{ matrix.dotnet-version }} dotnet-version: ${{ matrix.dotnet-version }}
- name: Install project
run: make install
- name: Run tests - name: Run tests
run: make test run: make test

View File

@@ -16,7 +16,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
ref: ${{ gitea.head_ref }} ref: ${{ gitea.head_ref }}
- run: echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - run: echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')" >> $GITHUB_ENV
shell: bash shell: bash
- run: echo "REPOSITORY_URLNAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}')" >> $GITHUB_ENV - run: echo "REPOSITORY_URLNAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}')" >> $GITHUB_ENV

View File

@@ -10,7 +10,7 @@ jobs:
sonarqube: sonarqube:
name: SonarQube Trigger name: SonarQube Trigger
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ !endsWith (github.repository, 'Templates/Dotnet_Executable') }} if: ${{ !contains ('project_name', format('{0}_{1}', 'project', 'name')) }}
steps: steps:
- name: Checking out - name: Checking out
uses: actions/checkout@v4 uses: actions/checkout@v4

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/runtime:9.0 FROM mcr.microsoft.com/dotnet/runtime:9.0
COPY . /app COPY ./project_name/bin/Release/net9.0/ /app
WORKDIR /app WORKDIR /app
CMD ["project_name"] CMD ["project_name"]

View File

@@ -5,6 +5,18 @@ help: ## Show the help.
@echo "Targets:" @echo "Targets:"
@fgrep "##" Makefile | fgrep -v fgrep @fgrep "##" Makefile | fgrep -v fgrep
.PHONY: buildrel
buildrel: ## Format code.
dotnet build -c Release project_name.sln
.PHONY: build
build: ## Format code.
dotnet build project_name.sln
.PHONY: publish
publish: ## Format code.
dotnet publish -c Release project_name.sln
.PHONY: fmt .PHONY: fmt
fmt: ## Format code. fmt: ## Format code.
dotnet format project_name.sln dotnet format project_name.sln
@@ -14,7 +26,7 @@ lint: ## Lint code.
dotnet format --verify-no-changes --verbosity diagnostic project_name.sln dotnet format --verify-no-changes --verbosity diagnostic project_name.sln
.PHONY: test .PHONY: test
test: lint ## Run tests and generate coverage report. test: ## Run tests and generate coverage report.
dotnet test project_name.sln dotnet test project_name.sln
.PHONY: clean .PHONY: clean
@@ -40,11 +52,6 @@ docs: ## Build the documentation.
@$(ENV_PREFIX)mkdocs build @$(ENV_PREFIX)mkdocs build
URL="site/index.html"; xdg-open $$URL || sensible-browser $$URL || x-www-browser $$URL || gnome-open $$URL || open $$URL URL="site/index.html"; xdg-open $$URL || sensible-browser $$URL || x-www-browser $$URL || gnome-open $$URL || open $$URL
.PHONY: init
init: ## Initialize the project based on an application template.
@./.gitea/init.sh
# This project has been generated from rochacbruno/python-project-template # This project has been generated from rochacbruno/python-project-template
# __author__ = 'rochacbruno' # __author__ = 'rochacbruno'
# __repo__ = https://github.com/rochacbruno/python-project-template # __repo__ = https://github.com/rochacbruno/python-project-template

View File

@@ -9,7 +9,7 @@ See also
### HOW TO USE THIS TEMPLATE ### HOW TO USE THIS TEMPLATE
1. Create a new repository from this template and choose a name for your project 1. Create a new repository from this template and choose a name for your project
(e.g. `my_awesome_project` - recommendation is to use all lowercase and underscores separation for repo names.) (e.g. `my_awesome_project` - recommendation is to use underscores separation for repo names.)
2. Wait until the first run of CI finishes (Gitea Actions will process the template and commit to your new repo) 2. Wait until the first run of CI finishes (Gitea Actions will process the template and commit to your new repo)
3. Read the file [CONTRIBUTING.md](CONTRIBUTING.md) 3. Read the file [CONTRIBUTING.md](CONTRIBUTING.md)
4. Then clone your new project and happy coding! 4. Then clone your new project and happy coding!