Skip to content

Commit

Permalink
Release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
offici5l committed Oct 22, 2024
1 parent 3c2a684 commit 21b6083
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,23 @@ jobs:
version=$(grep -oP '(?<=version = ")(.*)(?=")' MiUnlockTool.py)
echo "VERSION=$version" >> $GITHUB_ENV
- name: Check if tag exists
id: check_tag
- name: tag
run: |
if git tag | grep -q "$VERSION"; then
echo "Tag $VERSION already exists."
echo "TAG_EXISTS=true" >> $GITHUB_ENV
else
echo "Tag $VERSION does not exist."
echo "TAG_EXISTS=false" >> $GITHUB_ENV
if ! git tag | grep -q "$VERSION"; then
git tag "$VERSION"
git push origin "$VERSION"
fi
- name: Create tag if not exists
if: env.TAG_EXISTS == 'false'
- name: release
run: |
git tag "$VERSION"
git push origin "$VERSION"
if ! gh release view $VERSION; then
gh release create $VERSION --title "Release $VERSION" --notes "VERSION: $VERSION"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ env.VERSION }}

- name: Add miunlock version and upload file
- name: upload
run: |
gh release edit $VERSION --notes "VERSION: $VERSION"
gh release upload $VERSION ./MiUnlockTool.py --clobber
Expand Down

0 comments on commit 21b6083

Please sign in to comment.