Skip to content

Commit 0be58db

Browse files
authored
Merge pull request #1332 from microsoftgraph/fix/gh-actions
Disable automated tagging & releases for v2 preview releases
2 parents 6fee1cc + 19a811a commit 0be58db

File tree

2 files changed

+26
-35
lines changed

2 files changed

+26
-35
lines changed
Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
name: "create release"
22

33
on:
4-
push:
5-
tags:
6-
'*'
4+
workflow_dispatch:
75

86
defaults:
97
run:
108
shell: bash
119

1210
jobs:
11+
create-tag:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
SDK_VERSION: ${{ steps.tag-step.outputs.SDK_VERSION }}
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Get SDK version and set environment variable
19+
run: |
20+
SDK_VERSION=$(grep 'SDK_VERSION' src/GraphConstants.php | grep -oE '[0-9]+\.[0-9]+\.[0-9A-Za-z.\-]+')
21+
echo "SDK_VERSION=$SDK_VERSION" >> $GITHUB_ENV
22+
23+
- id: tag-step
24+
name: Create and publish tag
25+
run: |
26+
echo "SDK_VERSION is:"$SDK_VERSION
27+
git tag $SDK_VERSION && git push origin $SDK_VERSION
28+
echo "SDK_VERSION=$SDK_VERSION" >> "$GITHUB_OUTPUT"
29+
1330
create-release:
31+
needs: create-tag
32+
env:
33+
SDK_VERSION: ${{ needs.create-tag.outputs.SDK_VERSION }}
1434
runs-on: ubuntu-latest
1535
permissions:
1636
contents: write
@@ -20,5 +40,7 @@ jobs:
2040
uses: ncipollo/release-action@v1
2141
with:
2242
generateReleaseNotes: true
23-
prerelease: ${{ contains(github.ref_name, 'RC') }}
43+
prerelease: ${{ contains( env.SDK_VERSION, 'RC') }}
2444
skipIfReleaseExists: true
45+
tag: ${{ env.SDK_VERSION }}
46+
name: "Release ${{ env.SDK_VERSION }}"

.github/workflows/tag-release.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)