Skip to content

Commit 589ba42

Browse files
committed
add release scripts
1 parent f2e76b3 commit 589ba42

File tree

7 files changed

+48
-2
lines changed

7 files changed

+48
-2
lines changed

.github/workflows/build-with-shellcheck.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
with:
1111
fetch-depth: 0
1212
- run: sudo apt install shellcheck pandoc dpkg-dev
13-
- run: ./build.sh
13+
- run: ./scripts/build.sh
1414
- uses: actions/upload-artifact@v4
1515
with:
1616
name: deliverables

Makefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ clean:
22
rm -rf target *.deb *.deb.sha256sum *.deb.sha512sum
33

44
build:
5-
./build.sh
5+
./scripts/build.sh
6+
set-version:
7+
scripts/set-version.sh
8+
git-commit-and-push:
9+
scripts/git-commit-and-push.sh
10+
create-release:
11+
scripts/create-release.sh
612

713
test-man:
814
pandoc src/md/image-sitter-delete-if-exists.1.md -s -t man | man -l -

release.env

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
RELEASE_VERSION=1.2.0
6+
RELEASE_TITLE=''
7+
ISSUE_TO_CLOSE=""
8+
9+
export RELEASE_VERSION RELEASE_TITLE ISSUE_TO_CLOSE
File renamed without changes.

scripts/create-release.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# shellcheck disable=SC1091
5+
. ./release.env
6+
7+
RELEASE_NOTE="$RELEASE_TITLE"
8+
9+
gh release create "$RELEASE_VERSION" --title "$RELEASE_TITLE" --notes "${RELEASE_NOTE}" --latest

scripts/git-commit-and-push.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# shellcheck disable=SC1091
5+
. ./release.env
6+
7+
if [ -z "$ISSUE_TO_CLOSE" ]; then
8+
GIT_MESSAGE="$RELEASE_TITLE"
9+
else
10+
GIT_MESSAGE="$RELEASE_TITLE, Close $ISSUE_TO_CLOSE"
11+
fi
12+
13+
set -x
14+
git commit -m "$GIT_MESSAGE"
15+
git push

scripts/set-version.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# shellcheck disable=SC1091
5+
. ./release.env
6+
7+
sed -i 'src/DEBIAN/control' -e 's@Version: .*@Version: '"$RELEASE_VERSION"'@g'

0 commit comments

Comments
 (0)