| 1 | # AIGuiders.GitMcp.Core — restore с nuget.org (Trusted Publishing: репо KarataevDmitry/git-mcp-core). |
| 2 | name Release |
| 3 | |
| 4 | on |
| 5 | push: |
| 6 | tags: |
| 7 | - 'v*' |
| 8 | workflow_dispatch: |
| 9 | inputs: |
| 10 | tag: |
| 11 | description: 'Тег для GitHub Release. Пусто — ZIP …-manual-<run_id>-… без релиза.' |
| 12 | required: false |
| 13 | type: string |
| 14 | |
| 15 | permissions |
| 16 | contents: write |
| 17 | |
| 18 | env |
| 19 | DOTNET_VERSION: '10.0.x' |
| 20 | RELEASE_RIDS: 'win-x64 linux-x64 osx-x64 osx-arm64' |
| 21 | ARTIFACT_PREFIX: GitMcp |
| 22 | ZIP_LABEL: ${{ github.ref_type == 'tag' && github.ref_name || ((github.event.inputs.tag || '') != '' && github.event.inputs.tag || format('manual-{0}', github.run_id)) }} |
| 23 | |
| 24 | jobs |
| 25 | publish: |
| 26 | runs-on: ubuntu-latest |
| 27 | steps: |
| 28 | - uses: actions/checkout@v4 |
| 29 | with: |
| 30 | path: src/git-mcp |
| 31 | |
| 32 | - uses: actions/setup-dotnet@v4 |
| 33 | with: |
| 34 | dotnet-version: ${{ env.DOTNET_VERSION }} |
| 35 | |
| 36 | - name: Publish (self-contained) per RID |
| 37 | working-directory: src/git-mcp |
| 38 | run: | |
| 39 | set -euo pipefail |
| 40 | mkdir -p ../../dist |
| 41 | for rid in ${{ env.RELEASE_RIDS }}; do |
| 42 | out="../../publish/${rid}" |
| 43 | dotnet publish GitMcp.csproj -c Release -r "$rid" --self-contained true -o "$out" |
| 44 | (cd "$out" && zip -r "../../dist/${ARTIFACT_PREFIX}-${ZIP_LABEL}-${rid}.zip" .) |
| 45 | done |
| 46 | (cd "$GITHUB_WORKSPACE/dist" && sha256sum *.zip > SHA256SUMS) |
| 47 | |
| 48 | - name: GitHub Release |
| 49 | if: ${{ github.ref_type == 'tag' || (github.event_name == 'workflow_dispatch' && (github.event.inputs.tag || '') != '') }} |
| 50 | uses: softprops/action-gh-release@v2 |
| 51 | with: |
| 52 | tag_name: ${{ github.ref_type == 'tag' && github.ref_name || github.event.inputs.tag }} |
| 53 | generate_release_notes: true |
| 54 | files: | |
| 55 | dist/*.zip |
| 56 | dist/SHA256SUMS |
| 57 | env: |
| 58 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 59 | |
View only · write via MCP/CIDE