diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 1a543e0f..837a48ab 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -5,8 +5,10 @@ on: branches: - 'main' pull_request: + permissions: contents: read + env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_NOLOGO: true diff --git a/.github/workflows/create-tag-release.yml b/.github/workflows/create-tag-release.yml index d7d76dfb..dead9482 100644 --- a/.github/workflows/create-tag-release.yml +++ b/.github/workflows/create-tag-release.yml @@ -4,9 +4,11 @@ on: tags: - '[0-9]+.[0-9]+.[0-9]+' - '[0-9]+.[0-9]+.[0-9]+-beta[0-9]+' + permissions: actions: write contents: write + env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_NOLOGO: true @@ -91,23 +93,22 @@ jobs: - run: echo "PACKAGE=$(find . -name "EcoCode.${{ needs.versioning.outputs.tag }}.nupkg" | head -n 1)" >> $GITHUB_ENV - run: dotnet nuget push ${{ env.PACKAGE }} -k "${{ secrets.NUGET_API_KEY }}" -s https://api.nuget.org/v3/index.json - # Reenable when we have a VS Marketplace account and API key - # publish-vsix: # Only if both builds succeeded, and the tag is not a pre-release - # needs: [versioning, build-nuget, build-vsix] - # if: ${{ needs.versioning.outputs.tag == needs.versioning.outputs.version }} - # runs-on: windows-latest - # steps: - # - uses: actions/cache/restore@v4 - # with: - # path: vsix - # key: cache-${{ github.sha }} - # enableCrossOsArchive: true - # fail-on-cache-miss: true - # - uses: cezarypiatek/VsixPublisherAction@1.1 - # with: - # extension-file: vsix\EcoCode.vsix - # publish-manifest-file: vsix\publishManifest.json - # personal-access-code: ${{ secrets.VSMARKETPLACE_API_KEY }} + publish-vsix: # Only if both builds succeeded, and the tag is not a pre-release + needs: [versioning, build-nuget, build-vsix] + if: ${{ needs.versioning.outputs.tag == needs.versioning.outputs.version }} + runs-on: windows-latest + steps: + - uses: actions/cache/restore@v4 + with: + path: vsix + key: cache-${{ github.sha }} + enableCrossOsArchive: true + fail-on-cache-miss: true + - uses: cezarypiatek/VsixPublisherAction@1.1 + with: + extension-file: vsix\EcoCode.vsix + publish-manifest-file: vsix\publishManifest.json + personal-access-code: ${{ secrets.VSMARKETPLACE_API_KEY }} create-release: # Only if both builds succeeded needs: [versioning, build-nuget, build-vsix] @@ -135,29 +136,29 @@ jobs: nupkg/**/EcoCode.${{ needs.versioning.outputs.tag }}.nupkg vsix/EcoCode.vsix - # Use when the live warning project is hosted and ready - # update-live-warnings-project: + # Adapt when the test project is hosted and ready + # update-test-project: # needs: create-release # runs-on: ubuntu-latest # steps: - # - name: Checkout live warnings project + # - name: Checkout test project # uses: actions/checkout@v4 # with: - # repository: 'your-github-username/live-warnings-repository' - # token: ${{ secrets.ACCESS_TOKEN }} - # path: 'live-warnings' + # repository: 'your-github-username/ecoCode-csharp-test-project' + # token: ${{ secrets.TESTPROJECT_ACCESS_TOKEN }} + # path: 'test-project' # - name: Update package version in csproj # run: | - # sed -i 's//' live-warnings/ecoCode-csharp-livewarnings.csproj + # sed -i 's//' test-project/ecoCode-csharp-test-project.csproj # - name: Commit and push if changed # run: | - # cd live-warnings + # cd test-project # git config user.name github-actions # git config user.email github-actions@github.com # git add . # git commit -m "Update EcoCode package version to ${{ needs.versioning.outputs.tag }}" || exit 0 # git push # env: - # ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + # ACCESS_TOKEN: ${{ secrets.TESTPROJECT_ACCESS_TOKEN }} diff --git a/README.md b/README.md index ea0b0507..13b3d66d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This set of Roslyn analyzers implements these catalogs as rules for scanning you There are several ways you can use the ecoCode analyzers in your .Net projects: 1. As a NuGet package : https://www.nuget.org/packages/EcoCode/. -2. As a Visual Studio extension, you'll find the .vsix file in the [latest release](https://github.com/green-code-initiative/ecoCode-csharp/releases/latest) on GitHub. It will be published on the VS marketplace once everything is ready ! +2. As a Visual Studio extension : https://marketplace.visualstudio.com/items?itemName=ecoCode.ecoCode 3. Coming soon : as a VS Code extension. 4. Coming soon : as a .Net CLI Tool to scan existing code bases. 5. Coming soon : a documentation on how to set up [SonarScanner for .Net](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarscanner-for-dotnet/) and display the EcoCode warnings in [SonarQube](https://www.sonarsource.com/products/sonarqube/). diff --git a/global.json b/global.json index e0016bf4..1bd81769 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.203", + "version": "8.0.204", "rollForward": "latestMajor" } -} \ No newline at end of file +} diff --git a/src/EcoCode.Vsix/EcoCode.Vsix.csproj b/src/EcoCode.Vsix/EcoCode.Vsix.csproj index ad943062..c125c33a 100644 --- a/src/EcoCode.Vsix/EcoCode.Vsix.csproj +++ b/src/EcoCode.Vsix/EcoCode.Vsix.csproj @@ -46,4 +46,15 @@ + + + + + + + + + + +