migrated workflows to gitea
Publish Nuget Packages / publish (OmegaLeo.HelperLib) (release) Successful in 56s
Publish Nuget Packages / publish (OmegaLeo.HelperLib.Changelog) (release) Successful in 55s
Publish Nuget Packages / publish (OmegaLeo.HelperLib.Documentation) (release) Successful in 1m1s
Publish Nuget Packages / publish (OmegaLeo.HelperLib.Game) (release) Successful in 53s
Publish Nuget Packages / publish (OmegaLeo.HelperLib.Shared) (release) Successful in 40s
Publish Nuget Packages / publish (OmegaLeo.HelperLib) (release) Successful in 56s
Publish Nuget Packages / publish (OmegaLeo.HelperLib.Changelog) (release) Successful in 55s
Publish Nuget Packages / publish (OmegaLeo.HelperLib.Documentation) (release) Successful in 1m1s
Publish Nuget Packages / publish (OmegaLeo.HelperLib.Game) (release) Successful in 53s
Publish Nuget Packages / publish (OmegaLeo.HelperLib.Shared) (release) Successful in 40s
This commit is contained in:
Executable
+60
@@ -0,0 +1,60 @@
|
||||
name: Create Tag
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tagName:
|
||||
description: 'Tag name:'
|
||||
type: string
|
||||
required: true
|
||||
run-name: "Generating changelog and Creating Tag for Release v${{github.event.inputs.tagName}}"
|
||||
jobs:
|
||||
generate_changelog:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
token: ${{ secrets.TOKEN }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '9.0.x'
|
||||
|
||||
- name: Update OmegaLeo.HelperLib Version
|
||||
run: sed -i "s/\(<Version>\)[0-9]\+\.[0-9]\+\.[0-9]\+/\1${{github.event.inputs.tagName}}/" "./OmegaLeo.HelperLib/OmegaLeo.HelperLib.csproj"
|
||||
|
||||
- name: Update OmegaLeo.HelperLib.Changelog Version
|
||||
run: sed -i "s/\(<Version>\)[0-9]\+\.[0-9]\+\.[0-9]\+/\1${{github.event.inputs.tagName}}/" "./OmegaLeo.HelperLib.Changelog/OmegaLeo.HelperLib.Changelog.csproj"
|
||||
|
||||
- name: Update OmegaLeo.HelperLib.Documentation Version
|
||||
run: sed -i "s/\(<Version>\)[0-9]\+\.[0-9]\+\.[0-9]\+/\1${{github.event.inputs.tagName}}/" "./OmegaLeo.HelperLib.Documentation/OmegaLeo.HelperLib.Documentation.csproj"
|
||||
|
||||
- name: Update OmegaLeo.HelperLib.Game Version
|
||||
run: sed -i "s/\(<Version>\)[0-9]\+\.[0-9]\+\.[0-9]\+/\1${{github.event.inputs.tagName}}/" "./OmegaLeo.HelperLib.Game/OmegaLeo.HelperLib.Game.csproj"
|
||||
|
||||
- name: Update OmegaLeo.HelperLib.Shared Version
|
||||
run: sed -i "s/\(<Version>\)[0-9]\+\.[0-9]\+\.[0-9]\+/\1${{github.event.inputs.tagName}}/" "./OmegaLeo.HelperLib.Shared/OmegaLeo.HelperLib.Shared.csproj"
|
||||
|
||||
- name: Build Solution
|
||||
run: dotnet build --configuration Release
|
||||
|
||||
- name: Run Changelog Generator
|
||||
run: dotnet run --project "./OmegaLeo.HelperLib.ChangelogHandler/OmegaLeo.HelperLib.ChangelogHandler.csproj" --configuration Release
|
||||
env:
|
||||
TAG_VERSION: ${{ github.event.inputs.tagName }}
|
||||
|
||||
- name: Commit and Push Changes
|
||||
run: |
|
||||
git config --local user.email "nunodiogo@omegaleo.pt"
|
||||
git config --local user.name "Nuno Diogo"
|
||||
git add .
|
||||
git diff --staged --quiet || git commit -m "chore: update changelog and version to v${{github.event.inputs.tagName}}"
|
||||
git push origin ${{ github.ref }}
|
||||
|
||||
- name: Create and Push Tag
|
||||
run: |
|
||||
git tag -a "${{ github.event.inputs.tagName }}" -m "Release ${{ github.event.inputs.tagName }}"
|
||||
git push origin "${{ github.event.inputs.tagName }}"
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
# This workflow will build a .NET project
|
||||
# Runs on Gitea Actions (GitHub Actions compatible syntax): https://docs.gitea.com/usage/actions/overview
|
||||
|
||||
name: .NET
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
- name: Build
|
||||
run: dotnet build --no-restore
|
||||
- name: Test
|
||||
run: dotnet test --no-build --verbosity normal
|
||||
@@ -0,0 +1,30 @@
|
||||
name: Publish to Gitea Packages
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag_name:
|
||||
description: 'Version tag (e.g., 1.0.0)'
|
||||
required: true
|
||||
type: string
|
||||
run-name: "Publish version v${{ inputs.tag_name }} to Gitea Packages"
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
project:
|
||||
- OmegaLeo.HelperLib
|
||||
- OmegaLeo.HelperLib.Changelog
|
||||
- OmegaLeo.HelperLib.Game
|
||||
- OmegaLeo.HelperLib.Documentation
|
||||
- OmegaLeo.HelperLib.Shared
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup .Net Core
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
- name: Create Nuget Package
|
||||
run: dotnet pack "./${{ matrix.project }}/${{ matrix.project }}.csproj" -c Release /p:Version=${{ inputs.tag_name }}
|
||||
- name: Publish to Gitea Packages
|
||||
run: dotnet nuget push ./${{ matrix.project }}/bin/Release/${{ matrix.project }}.${{ inputs.tag_name }}.nupkg --api-key ${{ secrets.TOKEN }} --source ${{ github.server_url }}/api/packages/${{ github.repository_owner }}/nuget/index.json --skip-duplicate
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
name: Publish Nuget Packages
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
run-name: "Publish version v${{ github.event.release.tag_name }} to nuget"
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
project:
|
||||
- OmegaLeo.HelperLib
|
||||
- OmegaLeo.HelperLib.Changelog
|
||||
- OmegaLeo.HelperLib.Game
|
||||
- OmegaLeo.HelperLib.Documentation
|
||||
- OmegaLeo.HelperLib.Shared
|
||||
env:
|
||||
VERSION: ${{ github.event.release.tag_name }}
|
||||
PACKAGE: ./${{ matrix.project }}/bin/Release/${{ matrix.project }}.${{ github.event.release.tag_name }}.nupkg
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup .Net Core
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
- name: Create Nuget Package
|
||||
run: dotnet pack "./${{ matrix.project }}/${{ matrix.project }}.csproj" -c Release /p:Version=$VERSION /p:PackageReleaseNotes="See ${{ github.server_url }}/${{ github.repository }}/releases/tag/$VERSION"
|
||||
- name: Publish Nuget Package
|
||||
run: dotnet nuget push "$PACKAGE" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
|
||||
- name: Publish to Gitea Packages
|
||||
run: dotnet nuget push "$PACKAGE" --api-key ${{ secrets.TOKEN }} --source ${{ github.server_url }}/api/packages/${{ github.repository_owner }}/nuget/index.json --skip-duplicate
|
||||
- name: Upload assets to release
|
||||
run: |
|
||||
curl --fail --silent --show-error \
|
||||
-H "Authorization: token ${{ secrets.TOKEN }}" \
|
||||
-F "attachment=@$PACKAGE" \
|
||||
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=${{ matrix.project }}.$VERSION.nupkg"
|
||||
Reference in New Issue
Block a user