Skip to content

test(extension): сверка docs/bsl перестаёт схлопывать пробелы внутри … #59

test(extension): сверка docs/bsl перестаёт схлопывать пробелы внутри …

test(extension): сверка docs/bsl перестаёт схлопывать пробелы внутри … #59

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.25.0"
cache: true
- run: go test ./... -v -race
build:
name: Build ${{ matrix.goos }}/${{ matrix.goarch }}
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64, arm64]
include:
- goos: windows
ext: .exe
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: "1.25.0"
cache: true
- name: Determine version
id: version
run: |
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
else
echo "version=dev-${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT"
fi
- name: Build
env:
CGO_ENABLED: "0"
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
OUTFILE="mcp-1c-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }}"
go build -ldflags "-s -w -X main.version=${{ steps.version.outputs.version }}" \
-o "dist/${OUTFILE}" ./cmd/mcp-1c/
- uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/
retention-days: 1
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist/
merge-multiple: true
- name: List artifacts
run: ls -lh dist/
- name: Compute SHA256 over every binary
working-directory: dist
run: |
sha256sum mcp-1c-* > checksums.txt
cat checksums.txt
- name: Verify release payload before publishing
run: |
set -euo pipefail
expected=6
binaries=$(find dist -maxdepth 1 -type f -name 'mcp-1c-*' | wc -l | tr -d '[:space:]')
if [ ! -s dist/checksums.txt ]; then
echo "::error::dist/checksums.txt is missing or empty"
exit 1
fi
lines=$(wc -l < dist/checksums.txt | tr -d '[:space:]')
echo "binaries=${binaries} checksum lines=${lines} expected=${expected}"
if [ "${binaries}" -ne "${expected}" ]; then
echo "::error::found ${binaries} mcp-1c-* binaries in dist/, expected ${expected}"
exit 1
fi
if [ "${lines}" -ne "${expected}" ]; then
echo "::error::dist/checksums.txt has ${lines} lines, expected ${expected}"
exit 1
fi
- uses: softprops/action-gh-release@v2
with:
files: |
dist/mcp-1c-*
dist/checksums.txt
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}