Skip to content

Commit

Permalink
Make tagging & release workflow manually triggered
Browse files Browse the repository at this point in the history
  • Loading branch information
Ndiritu committed Aug 30, 2023
1 parent 6fee1cc commit 19a811a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 35 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
name: "create release"

on:
push:
tags:
'*'
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
create-tag:
runs-on: ubuntu-latest
outputs:
SDK_VERSION: ${{ steps.tag-step.outputs.SDK_VERSION }}
steps:
- uses: actions/checkout@v3

- name: Get SDK version and set environment variable
run: |
SDK_VERSION=$(grep 'SDK_VERSION' src/GraphConstants.php | grep -oE '[0-9]+\.[0-9]+\.[0-9A-Za-z.\-]+')
echo "SDK_VERSION=$SDK_VERSION" >> $GITHUB_ENV
- id: tag-step
name: Create and publish tag
run: |
echo "SDK_VERSION is:"$SDK_VERSION
git tag $SDK_VERSION && git push origin $SDK_VERSION
echo "SDK_VERSION=$SDK_VERSION" >> "$GITHUB_OUTPUT"
create-release:
needs: create-tag
env:
SDK_VERSION: ${{ needs.create-tag.outputs.SDK_VERSION }}
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -20,5 +40,7 @@ jobs:
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
prerelease: ${{ contains(github.ref_name, 'RC') }}
prerelease: ${{ contains( env.SDK_VERSION, 'RC') }}
skipIfReleaseExists: true
tag: ${{ env.SDK_VERSION }}
name: "Release ${{ env.SDK_VERSION }}"
31 changes: 0 additions & 31 deletions .github/workflows/tag-release.yml

This file was deleted.

0 comments on commit 19a811a

Please sign in to comment.