Skip to content

Commit

Permalink
Merge pull request #1408 from microsoft/andreastman/FixReleasePlease
Browse files Browse the repository at this point in the history
Fixes branch filter for release deploy
  • Loading branch information
baywet authored Oct 3, 2024
2 parents c494e04 + 7face04 commit 9ad6d49
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 62 deletions.
124 changes: 62 additions & 62 deletions .github/workflows/build_test_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,68 +7,68 @@ on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
environment:
name: build_test
env:
TENANT_ID: ${{ secrets.TENANT_ID }}
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- run: npm run lint:eslint:loud
- run: npm run prettier:check
- name: Archive dist folders # archive dist folders to verify if they are transpiled correctly and available for publishing
uses: actions/upload-artifact@v4
with:
name: dist folders ${{ matrix.node-version }}
path: |
packages/abstractions/dist
packages/serialization/form/dist
packages/serialization/json/dist
packages/serialization/multipart/dist
packages/serialization/text/dist
packages/http/fetch/dist
packages/authentication/azure/dist
- run: npm run test:integrated
if: ${{env.TENANT_ID != '' }}
env:
TENANT_ID: ${{secrets.tenant_id}}
CLIENT_ID: ${{secrets.client_id}}
CLIENT_SECRET: ${{secrets.client_secret}}
USER_ID: ${{secrets.user_id}}
- run: npm run test
build:
runs-on: ubuntu-latest
environment:
name: build_test
env:
TENANT_ID: ${{ secrets.TENANT_ID }}
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- run: npm run lint:eslint:loud
- run: npm run prettier:check
- name: Archive dist folders # archive dist folders to verify if they are transpiled correctly and available for publishing
uses: actions/upload-artifact@v4
with:
name: dist folders ${{ matrix.node-version }}
path: |
packages/abstractions/dist
packages/serialization/form/dist
packages/serialization/json/dist
packages/serialization/multipart/dist
packages/serialization/text/dist
packages/http/fetch/dist
packages/authentication/azure/dist
- run: npm run test:integrated
if: ${{env.TENANT_ID != '' }}
env:
TENANT_ID: ${{secrets.tenant_id}}
CLIENT_ID: ${{secrets.client_id}}
CLIENT_SECRET: ${{secrets.client_secret}}
USER_ID: ${{secrets.user_id}}
- run: npm run test

publish-npm:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, 'chore(main)') && contains(github.event.head_commit.message, 'release')}}
needs: build
environment:
name: production_feed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: |
git config --global user.name '${GITHUB_ACTOR}'
git config --global user.email '${GITHUB_ACTOR}@users.noreply.github.com'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ secrets.GIT_USERNAME }}
- run: npm ci
- run: npm run build
- run: npx lerna publish from-package --yes
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
publish-npm:
if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, 'chore: release main') }}"
needs: build
environment:
name: production_feed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: |
git config --global user.name '${GITHUB_ACTOR}'
git config --global user.email '${GITHUB_ACTOR}@users.noreply.github.com'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ secrets.GIT_USERNAME }}
- run: npm ci
- run: npm run build
- run: npx lerna publish from-package --yes
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}


2 changes: 2 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"separate-pull-requests": false,
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"skip-github-release": true,
"versioning": "prerelease",
"last-release-sha": "f13c350c40b76f7dff25e71e6ceeeb0066aa02be",
"packages": {
"packages/abstractions": {
"component": "@microsoft/kiota-abstractions",
Expand Down

0 comments on commit 9ad6d49

Please sign in to comment.