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