Skip to content

Commit

Permalink
Added release script and appdata.xml (#1028)
Browse files Browse the repository at this point in the history
  • Loading branch information
xarkes authored Dec 26, 2018
1 parent af7df82 commit 3e922a8
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
49 changes: 49 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/sh
# A small script to go faster when releasing

FILES=".appveyor.yml README.md docs/_config.yml docs/index.md"

# Quick check on arguments
if [ ! "$#" -eq 1 ]; then
echo "Usage: $0 <release version>"
exit 1
fi

# Get old version in x.x.x format
old_version=$(git tag | grep v | tail -n1 | cut -c2-)
version="$1"

# Do files modification
git checkout -b "r${version}"
echo "Releasing version '${version}'..."

# Modify version in the global files
for file in ${FILES}; do
sed -i "s,${old_version},${version},g" "${file}"
done

# Add a row in appdata.xml
n=$(grep -ne 1.7.2 src/org.radare.Cutter.appdata.xml | cut -f1 -d:)
today=$(date +%F)
line="\ \ \ \ <release version=\"${version}\" date=\"${today}\" />"
sed -i "${n}i${line}" ./src/org.radare.Cutter.appdata.xml

# Show difference
git diff

# Commit and push
git add ${FILES} src/org.radare.Cutter.appdata.xml
git commit -m "Release ${version}"
git push origin "r${version}"

# Checkout to master and create tag
# Meanwhile, the branch must be merged into master
sleep 60
git checkout master
git pull
git tag "v${version}"
git push --tags

# Now print changelog...
git log "v${old_version}..HEAD"

1 change: 1 addition & 0 deletions src/org.radare.Cutter.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<update_contact>xarkes</update_contact>

<releases>
<release version="1.7.3" date="2018-12-26" />
<release version="1.7.2" date="2018-10-07" />
<release version="1.7.1" date="2018-08-25" />
<release version="1.7" date="2018-08-17" />
Expand Down

0 comments on commit 3e922a8

Please sign in to comment.