From edde7132414f2dc9e278b8a29c53711ea1b402ee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Feb 2026 10:07:05 +0000 Subject: [PATCH 1/2] Initial plan From 80c77edd8a49f08684f447151e6a3308f36e758b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Feb 2026 10:09:54 +0000 Subject: [PATCH 2/2] Update workflows: remove auto-publish on merge, add release-triggered publish workflow Co-authored-by: jogibear9988 <364896+jogibear9988@users.noreply.github.com> --- .github/workflows/dotnet.yml | 25 ++--------- .github/workflows/release.yml | 81 +++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 2002e9c..da98a2a 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -10,26 +10,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Fetch history - run: git fetch --prune --unshallow + - uses: actions/checkout@v4 - name: Setup .NET - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: 9.0.x - - - name: GitVersion - id: gitversion # step id used as reference for output values - uses: roryprimrose/rungitversion@v1 - - - name: Update project version - uses: roryprimrose/set-vs-sdk-project-version@v1 - with: - version: ${{ steps.gitversion.outputs.NuGetVersionV2 }} - assemblyVersion: ${{ steps.gitversion.outputs.AssemblySemVer }} - fileVersion: ${{ steps.gitversion.outputs.MajorMinorPatch }} - informationalVersion: ${{ steps.gitversion.outputs.InformationalVersion }} - - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -50,8 +35,4 @@ jobs: - name: Build run: dotnet build --no-restore - name: Test - run: dotnet test --no-build --verbosity normal - - name: Package - run: dotnet pack -c Debug -o . TiaCodegen/DotNetProjects.TiaCodegen.csproj - - name: Publish - run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json \ No newline at end of file + run: dotnet test --no-build --verbosity normal \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..287a98a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,81 @@ +name: Build Release + +on: + release: + types: [published] + +jobs: + build: + permissions: write-all + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.0.x + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: TiaCodegen-ts/package-lock.json + registry-url: 'https://registry.npmjs.org' + + - name: Get version from tag + id: get_version + run: | + VERSION="${{ github.event.release.tag_name }}" + echo "VERSION=${VERSION#v}" >> $GITHUB_OUTPUT + + - name: Update C# project version + uses: roryprimrose/set-vs-sdk-project-version@v1 + with: + version: ${{ steps.get_version.outputs.VERSION }} + assemblyVersion: ${{ steps.get_version.outputs.VERSION }} + fileVersion: ${{ steps.get_version.outputs.VERSION }} + informationalVersion: ${{ steps.get_version.outputs.VERSION }}-${{ github.sha }} + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore -c Release + + - name: Test + run: dotnet test --no-build -c Release --verbosity normal + + - name: Install TypeScript dependencies + run: npm ci + working-directory: TiaCodegen-ts + + - name: Update npm package version + run: npm version ${{ steps.get_version.outputs.VERSION }} --no-git-tag-version + working-directory: TiaCodegen-ts + + - name: Build TypeScript + run: npm run build + working-directory: TiaCodegen-ts + + - name: Test TypeScript + run: npm test + working-directory: TiaCodegen-ts + + - name: Package + run: dotnet pack -c Release -o . TiaCodegen/DotNetProjects.TiaCodegen.csproj + + - name: Upload to release + uses: AButler/upload-release-assets@v3.0 + with: + files: '*.nupkg' + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish to NuGet + run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s "https://api.nuget.org/v3/index.json" --skip-duplicate + + - name: Publish to npm + run: npm publish + working-directory: TiaCodegen-ts + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}