Publish MISTRALAI-AZURE-SDK #15
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: Publish MISTRALAI-AZURE-SDK | |
| permissions: | |
| contents: read | |
| id-token: write | |
| "on": | |
| push: | |
| branches: | |
| - v1 | |
| paths: | |
| - packages/mistralai-azure/RELEASES.md | |
| workflow_dispatch: | |
| inputs: | |
| confirm_publish: | |
| description: "Type 'publish' to confirm v2 release" | |
| required: true | |
| jobs: | |
| publish: | |
| if: github.event_name == 'push' || github.event.inputs.confirm_publish == 'publish' | |
| runs-on: ubuntu-24.04 | |
| environment: | |
| name: publish | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: "24" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install dependencies | |
| working-directory: packages/mistralai-azure | |
| run: npx -y -p npm@11.15.0 npm install --ignore-scripts --min-release-age=7 | |
| - name: Build package | |
| working-directory: packages/mistralai-azure | |
| run: npm run build | |
| - name: Publish package to npm | |
| working-directory: packages/mistralai-azure | |
| run: | | |
| VERSION=$(npm pkg get version | tr -d '"') | |
| echo "Detected version: $VERSION" | |
| if [[ "$VERSION" == *"-"* ]]; then | |
| PRERELEASE=${VERSION#*-} | |
| TAG=${PRERELEASE%%.*} | |
| else | |
| TAG="latest" | |
| fi | |
| echo "Staging under dist-tag: $TAG" | |
| npx -y -p npm@11.15.0 npm stage publish --tag "$TAG" --access public --provenance |