Skip to content

Commit 533fb74

Browse files
authored
fix: use setup-dotnet built-in NuGet cache (#313)
* fix: use setup-dotnet built-in NuGet cache instead of actions/cache The manual actions/cache step used ~/.nuget/packages which doesn't resolve correctly on Windows runners. setup-dotnet's built-in cache handles the platform-specific path automatically. * perf: speed up CI by caching IntelliJ Platform and avoiding double build - Cache ~/.intellijPlatform so the Rider SDK (~1GB) isn't re-downloaded on every run - On master, run only publishPlugin (which already depends on buildPlugin) instead of running buildPlugin then publishPlugin separately, avoiding a full double .NET compile - Add --parallel flag to Gradle for concurrent subproject execution
1 parent cc4e79a commit 533fb74

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

.github/workflows/main.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,31 @@ jobs:
2424
uses: actions/setup-dotnet@v4
2525
with:
2626
dotnet-version: '8.x'
27+
cache: true
28+
cache-dependency-path: src/dotnet/*/*.csproj
2729

2830
- name: Setup Gradle
2931
uses: gradle/actions/setup-gradle@0b6dd653ba04f4f93bf581ec31e66cbd7dcb644d # v4
3032

31-
- name: Cache NuGet packages
33+
- name: Cache IntelliJ Platform
3234
uses: actions/cache@v4
3335
with:
34-
path: ~/.nuget/packages
35-
key: ${{ runner.os }}-nuget-${{ hashFiles('src/dotnet/*/*.csproj', 'src/dotnet/*.props') }}
36-
restore-keys: |
37-
${{ runner.os }}-nuget-
36+
path: ~/.intellijPlatform
37+
key: intellij-${{ hashFiles('gradle.properties') }}
3838

3939
- name: Build Plugin
40-
run: ./gradlew buildPlugin --build-cache
40+
if: github.ref != 'refs/heads/master'
41+
run: ./gradlew buildPlugin --parallel --build-cache
42+
43+
- name: Build & Publish Plugin
44+
if: github.ref == 'refs/heads/master'
45+
run: ./gradlew publishPlugin -PBuildConfiguration="Release" -PPublishToken="$PUBLISH_KEY" --parallel --build-cache
46+
env:
47+
PUBLISH_KEY: ${{ secrets.PublishKey }}
4148

4249
- name: Publish Artifact
4350
uses: actions/upload-artifact@v4
4451
with:
4552
name: Artifacts
4653
path: output
4754
retention-days: 7
48-
49-
- name: Publish plugins to jetbrains
50-
run: ./gradlew publishPlugin -PBuildConfiguration="Release" -PPublishToken="$PUBLISH_KEY" --build-cache
51-
env:
52-
PUBLISH_KEY: ${{ secrets.PublishKey }}
53-
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'

0 commit comments

Comments
 (0)