diff --git a/README.md b/README.md index ed2e3d0..93871de 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,9 @@ This repository contains **29 reusable GitHub Actions** for CI/CD automation. | 🛡️ | [`codeql-analysis`][codeql-analysis] | Repository | Run CodeQL security analysis for a single language with conf... | Auto-detection, Token auth, Outputs | | 💾 | [`common-cache`][common-cache] | Repository | Standardized caching strategy for all actions | Caching, Outputs | | 🖼️ | [`compress-images`][compress-images] | Repository | Compress images on demand (workflow_dispatch), and at 11pm e... | Token auth, Outputs | -| 📝 | [`csharp-build`][csharp-build] | Build | Builds and tests C# projects. | Auto-detection, Token auth, Outputs | +| 📝 | [`csharp-build`][csharp-build] | Build | Builds and tests C# projects. | Caching, Auto-detection, Token auth, Outputs | | 📝 | [`csharp-lint-check`][csharp-lint-check] | Linting | Runs linters like StyleCop or dotnet-format for C# code styl... | Auto-detection, Token auth, Outputs | -| 📦 | [`csharp-publish`][csharp-publish] | Publishing | Publishes a C# project to GitHub Packages. | Auto-detection, Token auth, Outputs | +| 📦 | [`csharp-publish`][csharp-publish] | Publishing | Publishes a C# project to GitHub Packages. | Caching, Auto-detection, Token auth, Outputs | | 📦 | [`docker-build`][docker-build] | Build | Builds a Docker image for multiple architectures with enhanc... | Caching, Auto-detection, Token auth, Outputs | | ☁️ | [`docker-publish`][docker-publish] | Publishing | Simple wrapper to publish Docker images to GitHub Packages a... | Token auth, Outputs | | ✅ | [`eslint-lint`][eslint-lint] | Linting | Run ESLint in check or fix mode with advanced configuration ... | Caching, Token auth, Outputs | @@ -100,17 +100,17 @@ This repository contains **29 reusable GitHub Actions** for CI/CD automation. | Action | Description | Languages | Features | |:----------------------------------|:------------------------------------------------------|:----------|:---------------------------------------------| -| 📝 [`csharp-build`][csharp-build] | Builds and tests C# projects. | C#, .NET | Auto-detection, Token auth, Outputs | +| 📝 [`csharp-build`][csharp-build] | Builds and tests C# projects. | C#, .NET | Caching, Auto-detection, Token auth, Outputs | | 📦 [`docker-build`][docker-build] | Builds a Docker image for multiple architectures w... | Docker | Caching, Auto-detection, Token auth, Outputs | | 📦 [`go-build`][go-build] | Builds the Go project. | Go | Caching, Auto-detection, Token auth, Outputs | #### 🚀 Publishing (3 actions) -| Action | Description | Languages | Features | -|:--------------------------------------|:------------------------------------------------------|:-------------|:------------------------------------| -| 📦 [`csharp-publish`][csharp-publish] | Publishes a C# project to GitHub Packages. | C#, .NET | Auto-detection, Token auth, Outputs | -| ☁️ [`docker-publish`][docker-publish] | Simple wrapper to publish Docker images to GitHub ... | Docker | Token auth, Outputs | -| 📦 [`npm-publish`][npm-publish] | Publishes the package to the NPM registry with con... | Node.js, npm | Token auth, Outputs | +| Action | Description | Languages | Features | +|:--------------------------------------|:------------------------------------------------------|:-------------|:---------------------------------------------| +| 📦 [`csharp-publish`][csharp-publish] | Publishes a C# project to GitHub Packages. | C#, .NET | Caching, Auto-detection, Token auth, Outputs | +| ☁️ [`docker-publish`][docker-publish] | Simple wrapper to publish Docker images to GitHub ... | Docker | Token auth, Outputs | +| 📦 [`npm-publish`][npm-publish] | Publishes the package to the NPM registry with con... | Node.js, npm | Token auth, Outputs | #### 📦 Repository (6 actions) @@ -139,9 +139,9 @@ This repository contains **29 reusable GitHub Actions** for CI/CD automation. | [`codeql-analysis`][codeql-analysis] | - | ✅ | ✅ | ✅ | | [`common-cache`][common-cache] | ✅ | - | - | ✅ | | [`compress-images`][compress-images] | - | - | ✅ | ✅ | -| [`csharp-build`][csharp-build] | - | ✅ | ✅ | ✅ | +| [`csharp-build`][csharp-build] | ✅ | ✅ | ✅ | ✅ | | [`csharp-lint-check`][csharp-lint-check] | - | ✅ | ✅ | ✅ | -| [`csharp-publish`][csharp-publish] | - | ✅ | ✅ | ✅ | +| [`csharp-publish`][csharp-publish] | ✅ | ✅ | ✅ | ✅ | | [`docker-build`][docker-build] | ✅ | ✅ | ✅ | ✅ | | [`docker-publish`][docker-publish] | - | - | ✅ | ✅ | | [`eslint-lint`][eslint-lint] | ✅ | - | ✅ | ✅ | diff --git a/csharp-build/action.yml b/csharp-build/action.yml index a4934f6..38fbb13 100644 --- a/csharp-build/action.yml +++ b/csharp-build/action.yml @@ -151,18 +151,10 @@ runs: uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0 with: dotnet-version: ${{ steps.detect-dotnet-version.outputs.detected-version }} - - - name: Cache NuGet packages - id: cache-nuget - uses: ivuorinen/actions/common-cache@0fa9a68f07a1260b321f814202658a6089a43d42 - with: - type: 'nuget' - paths: '~/.nuget/packages' - key-files: '**/*.csproj,**/*.props,**/*.targets' - key-prefix: 'csharp-build' + cache: true + cache-dependency-path: '**/*.csproj' - name: Restore Dependencies - if: steps.cache-nuget.outputs.cache-hit != 'true' uses: step-security/retry@e1d59ce1f574b32f0915e3a8df055cfe9f99be5d # v3 with: timeout_minutes: 10 @@ -171,8 +163,7 @@ runs: echo "Restoring .NET dependencies..." dotnet restore --verbosity normal - - name: Skip Restore (Cache Hit) - if: steps.cache-nuget.outputs.cache-hit == 'true' + - name: Restore Complete shell: bash run: | echo "Cache hit - skipping dotnet restore" diff --git a/csharp-publish/action.yml b/csharp-publish/action.yml index e2a78bb..50c487c 100644 --- a/csharp-publish/action.yml +++ b/csharp-publish/action.yml @@ -161,28 +161,22 @@ runs: uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0 with: dotnet-version: ${{ inputs.dotnet-version || steps.detect-dotnet-version.outputs.detected-version }} - - - name: Cache NuGet packages - id: cache-nuget - uses: ivuorinen/actions/common-cache@0fa9a68f07a1260b321f814202658a6089a43d42 - with: - type: 'nuget' - paths: '~/.nuget/packages' - key-files: '**/*.csproj,**/*.props,**/*.targets' - key-prefix: 'csharp-publish' + cache: true + cache-dependency-path: '**/*.csproj' - name: Restore Dependencies - shell: bash - env: - CACHE_HIT: ${{ steps.cache-nuget.outputs.cache-hit }} - run: | - set -euo pipefail + uses: step-security/retry@e1d59ce1f574b32f0915e3a8df055cfe9f99be5d # v3 + with: + timeout_minutes: 10 + max_attempts: ${{ inputs.max-retries }} + command: | + echo "Restoring .NET dependencies..." + dotnet restore --verbosity normal - # Always run dotnet restore to ensure project.assets.json is present - if [[ "$CACHE_HIT" == 'true' ]]; then - echo "Cache hit - running fast dotnet restore" - fi - dotnet restore + - name: Restore Complete + shell: bash + run: | + echo "Cache hit - skipping dotnet restore" - name: Build Solution shell: bash