Skip to content

Commit

Permalink
Merge pull request #1254 from microsoftgraph/fix/gh-actions
Browse files Browse the repository at this point in the history
Update GitHub Workflows for v2 SDK
  • Loading branch information
Ndiritu authored Aug 17, 2023
2 parents 899cdf3 + b857999 commit 2ec9204
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 127 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/bump-generated-sdk-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

name: "Bump SDK version in generated pull request"

# Controls when the action will run. Triggers the workflow on push
# events but only for branches with the following branch spec: kiota/v1.0/pipelinebuild/*
on:
push:
branches:
- "kiota/v1.0/pipelinebuild/*"
paths:
- 'src/Generated/**'

defaults:
run:
shell: bash

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
bump-sdk-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Git config user
run: |
git config --global user.email "[email protected]"
git config --global user.name "Microsoft Graph DevX Tooling"
- name: Run increment script
run: php scripts/BumpPreviewSdkVersion.php

- name: Commit and push changes if any
run: if git commit -am "Bump SDK version"; then git push origin $GITHUB_REF; fi
24 changes: 24 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "create release"

on:
push:
tags:
'*'

defaults:
run:
shell: bash

jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Create Release
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
prerelease: ${{ contains(github.ref_name, 'RC') }}
skipIfReleaseExists: true
66 changes: 0 additions & 66 deletions .github/workflows/create-v1.0-pull-request.yml

This file was deleted.

9 changes: 7 additions & 2 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:
branches: [ main, dev, feat/kiota-preview ]
pull_request:
branches: [ main, dev, feat/kiota-preview ]
# Add assigned to defaults as a hack to easily trigger code-gen PRs to run validation
types: [assigned, opened, synchronize, reopened]

defaults:
run:
Expand All @@ -18,7 +16,14 @@ defaults:
jobs:
validate-pull-request:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1', '8.2']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- uses: actions/checkout@v3
- name: Validate composer file
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: "tag release"
on:
push:
branches:
- main
- feat/kiota-preview

defaults:
run:
Expand Down
58 changes: 0 additions & 58 deletions .github/workflows/update-docs.yml

This file was deleted.

0 comments on commit 2ec9204

Please sign in to comment.