Release #185
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - 'release' | |
| env: | |
| VERSION: '1.32.0' | |
| NUGET_REPO_URL: 'https://api.nuget.org/v3/index.json' | |
| jobs: | |
| CLI: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Sets environment variables - branch-name | |
| uses: christianhelle/branch-name@master | |
| - name: Sets environment variables - Nerdbank.GitVersioning | |
| uses: dotnet/nbgv@master | |
| with: | |
| setAllVars: true | |
| - name: Update Version | |
| run: ((Get-Content -Path Core/ApiClientCodeGen.Core/ApiClientCodeGen.Core.csproj -Raw) -Replace ">1.0.0<", ">${{ env.VERSION }}<") | Set-Content -Path Core/ApiClientCodeGen.Core/ApiClientCodeGen.Core.csproj | |
| working-directory: src | |
| - name: Build | |
| run: dotnet build -c Release /p:UseSourceLink=true src/Rapicgen.sln -p:PackageVersion="${{ env.VERSION }}" | |
| - name: Package CLI Tool | |
| run: dotnet pack --no-build -c Release /p:UseSourceLink=true src/CLI/ApiClientCodeGen.CLI/ApiClientCodeGen.CLI.csproj -p:PackageVersion="${{ env.VERSION }}" | |
| - name: Push packages to NuGet | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release' | |
| run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source ${{ env.NUGET_REPO_URL }} --no-symbols true | |
| continue-on-error: true | |
| - name: Publish artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: CLI Tool | |
| path: | | |
| **/*.nupkg | |
| docs/CLI.md | |
| VSIX: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Sets environment variables - branch-name | |
| uses: christianhelle/branch-name@master | |
| - name: Sets environment variables - Nerdbank.GitVersioning | |
| uses: dotnet/nbgv@master | |
| with: | |
| setAllVars: true | |
| - name: Update Version | |
| run: | | |
| ((Get-Content -Path Core/ApiClientCodeGen.Core/ApiClientCodeGen.Core.csproj -Raw) -Replace ">1.0.0<", ">${{ env.VERSION }}<") | Set-Content -Path Core/ApiClientCodeGen.Core/ApiClientCodeGen.Core.csproj | |
| ((Get-Content -Path VSIX/ApiClientCodeGen.VSIX/source.extension.vsixmanifest -Raw) -Replace "1.0.0", "${{ env.VERSION }}") | Set-Content -Path VSIX/ApiClientCodeGen.VSIX/source.extension.vsixmanifest | |
| ((Get-Content -Path VSIX/ApiClientCodeGen.VSIX.Dev17/source.extension.vsixmanifest -Raw) -Replace "1.0.0", "${{ env.VERSION }}") | Set-Content -Path VSIX/ApiClientCodeGen.VSIX.Dev17/source.extension.vsixmanifest | |
| working-directory: src | |
| shell: pwsh | |
| - name: Setup MSBuild.exe | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Restore | |
| run: msbuild VSIX.sln -t:Restore | |
| working-directory: src | |
| - name: Build | |
| run: msbuild VSIX.sln /property:Configuration=Release /p:DeployExtension=false | |
| working-directory: src | |
| - name: Move build output | |
| run: | | |
| mv src/VSIX/ApiClientCodeGen.VSIX/bin/Release/ApiClientCodeGenerator.vsix ApiClientCodeGenerator-VS2019-${{ env.VERSION }}.vsix | |
| mv src/VSIX/ApiClientCodeGen.VSIX.Dev17/bin/Release/ApiClientCodeGenerator.vsix ApiClientCodeGenerator-VS2022-${{ env.VERSION }}.vsix | |
| - name: Publish artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Visual Studio Extension | |
| path: | | |
| *.vsix | |
| docs/Marketplace*.md | |
| - name: Publish VSIX Packages | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release' | |
| run: | | |
| $VsixPublisher = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe" | |
| & $VsixPublisher login -personalAccessToken ${{ secrets.MARKETPLACE_PAT }} -publisherName ChristianResmaHelle | |
| & $VsixPublisher publish -payload ApiClientCodeGenerator-VS2019-${{ env.VERSION }}.vsix -publishManifest src/publish-manifest.json -ignoreWarnings 'VSIXValidatorWarning01,VSIXValidatorWarning02' | |
| & $VsixPublisher publish -payload ApiClientCodeGenerator-VS2022-${{ env.VERSION }}.vsix -publishManifest src/publish-manifest-vs2022.json -ignoreWarnings 'VSIXValidatorWarning01,VSIXValidatorWarning02' | |
| VSCode: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Bump VSCode extension version | |
| run: | | |
| sed -i "s/\"version\": \".*\"/\"version\": \"${{ env.VERSION }}\"/" src/VSCode/package.json | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '6.0.x' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: 'src/VSCode/package-lock.json' | |
| - name: Install dependencies | |
| run: | | |
| cd src/VSCode | |
| npm ci | |
| - name: Lint | |
| run: | | |
| cd src/VSCode | |
| npm run lint | |
| - name: Build | |
| run: | | |
| cd src/VSCode | |
| npm run compile | |
| - name: Package Extension | |
| run: | | |
| cd src/VSCode | |
| npm run package | |
| npm run vsix | |
| - name: Upload VSIX | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: VSCode-Extension | |
| path: src/VSCode/*.vsix | |
| - name: Publish to VS Code Marketplace | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release' | |
| run: | | |
| cd src/VSCode | |
| npx vsce publish -p ${{ secrets.MARKETPLACE_PAT }} | |
| IntelliJ: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle.properties') }} | |
| restore-keys: ${{ runner.os }}-gradle- | |
| - name: Update Version | |
| working-directory: src/IntelliJ | |
| shell: pwsh | |
| run: | | |
| ((Get-Content -Path gradle.properties -Raw) ` | |
| -Replace "pluginVersion=0.1.0", "pluginVersion=${{ env.VERSION }}") ` | |
| | Set-Content -Path gradle.properties | |
| - name: Build IntelliJ Plugin | |
| working-directory: src/IntelliJ | |
| run: ./gradlew buildPlugin --no-daemon | |
| - name: Archive plugin artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Intellij-Plugin | |
| path: src/IntelliJ/build/distributions/*.zip | |
| Release: | |
| needs: [ | |
| CLI, | |
| VSIX, | |
| VSCode, | |
| IntelliJ | |
| ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Create tag | |
| uses: actions/github-script@v8 | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release' | |
| with: | |
| github-token: ${{ github.token }} | |
| script: | | |
| github.rest.git.createRef({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| ref: "refs/tags/${{ env.VERSION }}", | |
| sha: context.sha | |
| }) | |
| - name: Create release | |
| id: create-release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ env.VERSION }} | |
| release_name: v${{ env.VERSION }} | |
| draft: true | |
| prerelease: false | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| path: artifacts | |
| - name: Upload VSIX asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create-release.outputs.upload_url }} | |
| asset_path: artifacts/Visual Studio Extension/ApiClientCodeGenerator-VS2019-${{ env.VERSION }}.vsix | |
| asset_name: ApiClientCodeGenerator-VS2019-${{ env.VERSION }}.vsix | |
| asset_content_type: application/zip | |
| - name: Upload VSIX for VS2022 asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create-release.outputs.upload_url }} | |
| asset_path: artifacts/Visual Studio Extension/ApiClientCodeGenerator-VS2022-${{ env.VERSION }}.vsix | |
| asset_name: ApiClientCodeGenerator-VS2022-${{ env.VERSION }}.vsix | |
| asset_content_type: application/zip | |
| - name: Upload VSCode asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create-release.outputs.upload_url }} | |
| asset_path: artifacts/VSCode-Extension/apiclientcodegen-${{ env.VERSION }}.vsix | |
| asset_name: apiclientcodegen-${{ env.VERSION }}.vsix | |
| asset_content_type: application/zip | |
| - name: Upload IntelliJ Plugin asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create-release.outputs.upload_url }} | |
| asset_path: artifacts/Intellij-Plugin/apiclientcodegen-intellij-${{ env.VERSION }}.zip | |
| asset_name: apiclientcodegen-intellij-${{ env.VERSION }}.zip | |
| asset_content_type: application/zip |