Skip to content

Commit

Permalink
. e test script for create release tag for autopublish: v4
Browse files Browse the repository at this point in the history
  • Loading branch information
yelmuratoff committed May 10, 2024
1 parent 7a02620 commit 4b0a0ca
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.4.2
## 0.4.3

- Test script for create release tag for autopublish

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Add the following to your `pubspec.yaml` file:

```yaml
dependencies:
approval_tests: ^0.4.2
approval_tests: ^0.4.3
```
## 📚 How to use
Expand Down
28 changes: 16 additions & 12 deletions bash/push_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@ if [ "$VERSION" = "$PUB_DEV_VERSION" ]; then
exit 1
else
echo "Version $VERSION is ready to be tagged and pushed."
# Check if the tag already exists
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
echo "Error: Tag v$VERSION already exists."
exit 1
fi


# Configure git user
git config --local user.email "actions@test.com"
git config --local user.name "Github Actions"
git config --local user.email "you@example.com"
git config --local user.name "Your Name"

# Create a tag in Git with the new version
echo "Publishing..."
git tag -a "v$VERSION" -m "Release version $VERSION"
git push origin "v$VERSION"
# Fetch tags from the remote to update local reference
git fetch --tags

# Check if the tag already exists in the remote
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
echo "Tag v$VERSION already exists. Skipping tag creation."
exit 0
else
# Create a tag in Git with the new version
echo "Publishing..."
git tag -a "v$VERSION" -m "Release version $VERSION"
git push origin "v$VERSION"
fi
fi
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# * 0.0.4 for a minor release.
name: approval_tests
description: Approval Tests implementation in Dart. Inspired by ApprovalTests.
version: 0.4.2
version: 0.4.3
repository: https://github.com/approvals/ApprovalTests.Dart
homepage: https://github.com/approvals/ApprovalTests.Dart.git
issue_tracker: https://github.com/approvals/ApprovalTests.Dart/issues
Expand Down

0 comments on commit 4b0a0ca

Please sign in to comment.