Skip to content

Commit

Permalink
[ Add ] added workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
anasfik committed Feb 17, 2023
1 parent d0d2652 commit 07fc2c5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,30 @@ jobs:
- uses: actions/checkout@v3

- name: Checking commit message

run: |
if grep -q "release" "$GITHUB_EVENT_PATH"; then
echo "This commit contains the word 'release'. Creating a release..."
else
echo "This commit does not contain the word 'release'. Exiting workflow."
exit 78
fi
echo "This commit contains the word 'release'. Creating a release..."
- name: Extracting Version Number Of The Current Release
run: |
VERSION=$(grep -oP "version:\s*\K.*" pubspec.yaml)
echo "VERSION: V$VERSION detected"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Check if release exists
id: check_release
uses: peter-evans/release-check@v1
with:
tag: ${{ env.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Creating New Release
if: steps.check_release.outputs.release_exists == 'false'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
draft: false
prerelease: false

0 comments on commit 07fc2c5

Please sign in to comment.