Compare commits

4 Commits

Author SHA1 Message Date
21f4e7765b Added uvicorn to API feature
All checks were successful
Test MycroForge.CLI / test (push) Has been skipped
2024-10-24 11:52:37 +02:00
33ba944f8a Updated scripts
All checks were successful
Test MycroForge.CLI / test (push) Successful in 2m23s
2024-10-13 18:12:04 +02:00
05051878f2 Cleaning up versions and workflows
All checks were successful
Test MycroForge.CLI / test (push) Has been skipped
2024-10-13 16:03:02 +02:00
3fff9c7dd0 Renamed build job to test 2024-10-13 15:34:33 +02:00
11 changed files with 92 additions and 12 deletions

View File

@@ -1,9 +1,9 @@
name: Build and publish MycroForge.CLI
run-name: ${{ gitea.actor }} triggered a build for the MycroForge.CLI
on: [ push ]
run-name: ${{ gitea.actor }} triggered a build for the MycroForge.CLI package
on: [ workflow_dispatch ]
jobs:
test:
build:
runs-on: ubuntu-latest
if: gitea.ref == 'refs/heads/main'
steps:
@@ -14,7 +14,8 @@ jobs:
- name: "Build and publish NuGet package"
run: |
# Build the NuGet package
cd MycroForge.CLI && dotnet pack -v m
cd MycroForge.CLI
dotnet pack -v m
# Add the NuGet source
dotnet nuget add source --name devdisciples \

View File

@@ -0,0 +1,33 @@
name: Build and publish MycroForge.Core
run-name: ${{ gitea.actor }} triggered a build for the MycroForge.Core package
on: [ workflow_dispatch ]
jobs:
build:
runs-on: ubuntu-latest
if: gitea.ref == 'refs/heads/main'
steps:
- uses: https://github.com/actions/checkout@v4
- uses: https://github.com/actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: "Build and publish NuGet package"
run: |
# Build the NuGet package
cd MycroForge.Core
dotnet publish
dotnet pack -v m
# Add the NuGet source
dotnet nuget add source --name devdisciples \
--username ${{ secrets.NUGET_USER }} \
--password ${{ secrets.NUGET_PASS }} \
--store-password-in-clear-text \
https://git.devdisciples.com/api/packages/devdisciples/nuget/index.json
# Set the path to the package
VERSION=$(grep '<Version>' < MycroForge.Core.csproj | sed 's/.*<Version>\(.*\)<\/Version>/\1/' | xargs)
PACKAGE="bin/Release/MycroForge.Core.$VERSION.nupkg"
# Push the package
dotnet nuget push "$PACKAGE" --source devdisciples

View File

@@ -0,0 +1,33 @@
name: Build and publish MycroForge.PluginTemplate package
run-name: ${{ gitea.actor }} triggered a build for the MycroForge.PluginTemplate package
on: [ workflow_dispatch ]
jobs:
build:
runs-on: ubuntu-latest
if: gitea.ref == 'refs/heads/main'
steps:
- uses: https://github.com/actions/checkout@v4
- uses: https://github.com/actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: "Build and publish NuGet package"
run: |
# Build the NuGet package
cd MycroForge.PluginTemplate.Package
dotnet publish
dotnet pack -v m
# Add the NuGet source
dotnet nuget add source --name devdisciples \
--username ${{ secrets.NUGET_USER }} \
--password ${{ secrets.NUGET_PASS }} \
--store-password-in-clear-text \
https://git.devdisciples.com/api/packages/devdisciples/nuget/index.json
# Set the path to the package
VERSION=$(grep '<PackageVersion>' < MycroForge.PluginTemplate.Package.csproj | sed 's/.*<PackageVersion>\(.*\)<\/PackageVersion>/\1/' | xargs)
PACKAGE="bin/Release/MycroForge.PluginTemplate.Package.$VERSION.nupkg"
# Push the package
dotnet nuget push "$PACKAGE" --source devdisciples

View File

@@ -52,7 +52,7 @@ public sealed partial class Api : IFeature
await context.Bash(
"source .venv/bin/activate",
"python3 -m pip install fastapi",
"python3 -m pip install fastapi uvicorn",
"python3 -m pip freeze > requirements.txt"
);

0
MycroForge.CLI/scripts/publish-tool.sh Normal file → Executable file
View File

View File

@@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<PackageId>MycroForge.Core</PackageId>
<Description>The MycroForge core package</Description>
<Version>1.0.0</Version>
<Version>0.0.1</Version>
<Authors>Donné Napo</Authors>
<Company>Dev Disciples</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

7
MycroForge.Core/scripts/publish-nuget.sh Normal file → Executable file
View File

@@ -1,4 +1,5 @@
#!/bin/bash
#!/bin/bash
dotnet build -r Release
dotnet nuget push --source devdisciples bin/Release/MycroForge.Core.1.0.0.nupkg
VERSION=$(grep '<Version>' < MycroForge.Core.csproj | sed 's/.*<Version>\(.*\)<\/Version>/\1/' | tr -d '[:space:]')
dotnet build -r Releasedo
dotnet nuget push --source devdisciples "bin/Release/MycroForge.Core.$VERSION.nupkg"

View File

@@ -4,7 +4,7 @@
<!-- The package metadata. Fill in the properties marked as TODO below -->
<!-- Follow the instructions on https://learn.microsoft.com/nuget/create-packages/package-authoring-best-practices -->
<PackageId>MycroForge.PluginTemplate.Package</PackageId>
<PackageVersion>1.0</PackageVersion>
<PackageVersion>0.0.1</PackageVersion>
<Title>A template for generating MycroForge plugins</Title>
<Authors>Donné Napo</Authors>
<Description>Template to use when creating a plugin for the MycroForge CLI.</Description>

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/env bash
rm -rf templates/MycroForge.PluginTemplate
cp -R ../MycroForge.PluginTemplate templates/MycroForge.PluginTemplate

View File

@@ -0,0 +1,12 @@
#!/bin/env bash
rm -rf templates/MycroForge.PluginTemplate
cp -R ../MycroForge.PluginTemplate templates/MycroForge.PluginTemplate
dotnet pack
# Set the path to the package
VERSION=$(grep '<PackageVersion>' < MycroForge.PluginTemplate.Package.csproj | sed 's/.*<PackageVersion>\(.*\)<\/PackageVersion>/\1/' | tr -d '[:space:]')
PACKAGE="bin/Release/MycroForge.PluginTemplate.Package.$VERSION.nupkg"
# Push the package
dotnet nuget push "$PACKAGE" --source devdisciples

View File

@@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MycroForge.Core" Version="1.0.0" />
<PackageReference Include="MycroForge.Core" Version="0.0.1" />
</ItemGroup>
</Project>