chore(deps): update dependency python to 3.14 #20
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: Build & Release | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: build-test (go ${{ matrix.go-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go-version: ['1.21.x', '1.22.x', '1.23.x'] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go ${{ matrix.go-version }} | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| cache: true | |
| - name: Install golangci-lint | |
| run: | | |
| curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.3 | |
| echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
| - name: Build | |
| run: make build | |
| - name: Run unit tests | |
| run: make unittest | |
| - name: Run linter | |
| run: make lint | |
| - name: Run go mod tidy | |
| run: make tidy | |
| create-release: | |
| name: semantic-release | |
| if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Notify Slack - Release Started | |
| run: | | |
| curl -X POST "${{ secrets.SLACK_RELEASE_WEBHOOK_URL }}" \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{ | |
| "sdk": "networking-go-sdk", | |
| "language": "go", | |
| "status": "started", | |
| "actor": "${{ github.actor }}" | |
| }' | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.14' | |
| - name: Install publishing tools | |
| run: | | |
| pip install bump2version | |
| npm ci | |
| - name: Validate version consistency | |
| run: | | |
| echo "=== Checking version consistency across files ===" | |
| # Extract versions from each file | |
| VERSION_GO=$(grep -oP 'const Version = "\K[^"]+' common/version.go) | |
| VERSION_CFG=$(grep -oP 'current_version = \K.*' .bumpversion.cfg) | |
| VERSION_README_TITLE=$(grep -oP 'IBM Cloud Networking Go SDK Version \K[0-9.]+' README.md | head -1) | |
| VERSION_README_CURRENT=$(grep -oP 'The current version of this SDK: \K[0-9.]+' README.md) | |
| VERSION_README_GOPKG=$(grep -oP 'version = "\K[^"]+' README.md | head -1) | |
| echo "common/version.go: $VERSION_GO" | |
| echo ".bumpversion.cfg: $VERSION_CFG" | |
| echo "README.md (title): $VERSION_README_TITLE" | |
| echo "README.md (current): $VERSION_README_CURRENT" | |
| echo "README.md (Gopkg): $VERSION_README_GOPKG" | |
| # Check if all versions match | |
| if [ "$VERSION_GO" != "$VERSION_CFG" ] || \ | |
| [ "$VERSION_GO" != "$VERSION_README_TITLE" ] || \ | |
| [ "$VERSION_GO" != "$VERSION_README_CURRENT" ] || \ | |
| [ "$VERSION_GO" != "$VERSION_README_GOPKG" ]; then | |
| echo "❌ ERROR: Version mismatch detected!" | |
| echo "All version strings must match before release." | |
| exit 1 | |
| fi | |
| echo "✅ All version strings match: $VERSION_GO" | |
| - name: Run semantic-release | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| run: npx semantic-release | |
| - name: Notify Slack - Release Completed | |
| if: success() | |
| run: | | |
| curl -X POST "${{ secrets.SLACK_RELEASE_WEBHOOK_URL }}" \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{ | |
| "sdk": "networking-go-sdk", | |
| "language": "go", | |
| "status": "completed", | |
| "actor": "${{ github.actor }}" | |
| }' | |
| - name: Notify Slack - Release Failed | |
| if: failure() | |
| run: | | |
| curl -X POST "${{ secrets.SLACK_RELEASE_WEBHOOK_URL }}" \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{ | |
| "sdk": "networking-go-sdk", | |
| "language": "go", | |
| "status": "failed", | |
| "actor": "${{ github.actor }}" | |
| }' |