Skip to content

Commit

Permalink
Merge pull request #27 from NicoHood/dev
Browse files Browse the repository at this point in the history
Release 1.4.1
  • Loading branch information
NicoHood committed Jan 31, 2021
2 parents e84a3b0 + f84d756 commit 1c3301c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 7 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ This changlog uses the [ISO 8601 date format](https://www.iso.org/iso-8601-date-

## [Unreleased]

## [1.4.1] - 2021-01-31

### Changed

* Update license date and add license to script

### Fixed

* Fixed Github API json escaping issue
* Added depcrecated warning about `--no-github` parameter

## [1.4.0] - 2021-01-29

### Added
Expand Down Expand Up @@ -170,7 +181,8 @@ This changlog uses the [ISO 8601 date format](https://www.iso.org/iso-8601-date-
### Added
- Initial release of the software

[Unreleased]: https://github.com/NicoHood/gpgit/compare/1.4.0...HEAD
[Unreleased]: https://github.com/NicoHood/gpgit/compare/1.4.1...HEAD
[1.4.1]: https://github.com/NicoHood/gpgit/compare/1.4.0...1.4.1
[1.4.0]: https://github.com/NicoHood/gpgit/compare/1.3.4...1.4.0
[1.3.4]: https://github.com/NicoHood/gpgit/compare/1.3.3...1.3.4
[1.3.3]: https://github.com/NicoHood/gpgit/compare/1.3.2...1.3.3
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016 NicoHood
Copyright (c) 2016-2021 NicoHood

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 3 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ The security status of GNU/Linux projects will be tracked in the [Linux Security
* [Arch Linux](https://archlinux.org/packages/community/any/gpgit/) `sudo pacman -S gpgit`

### Manual Installation

```bash
# Install dependencies and optional dependencies
sudo apt-get install bash gnupg2 git tar xz-utils coreutils gawk grep sed
sudo apt-get install gzip bzip lzip file jq curl

# Download and verify source
VERSION=1.4.0
VERSION=1.4.1
wget "https://github.com/NicoHood/gpgit/releases/download/${VERSION}/gpgit-${VERSION}.tar.xz"
wget "https://github.com/NicoHood/gpgit/releases/download/${VERSION}/gpgit-${VERSION}.tar.xz.asc"
gpg2 --keyserver hkps://keyserver.ubuntu.com --recv-keys 97312D5EB9D7AE7D0BD4307351DAE9B7C1AE9161
Expand All @@ -83,7 +84,7 @@ If you add and commit a `CHANGELOG.md` file to your Git with the [Keep a Changel
$ gpgit --help
Usage: gpgit [options] <tagname> [<commit> | <object>]
GPGit 1.4.0 https://github.com/NicoHood/gpgit
GPGit 1.4.1 https://github.com/NicoHood/gpgit
A shell script that automates the process of signing Git sources via GPG.
Mandatory arguments:
Expand Down
33 changes: 30 additions & 3 deletions gpgit.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
#!/usr/bin/env bash
VERSION="1.4.0"

# Copyright (c) 2016-2021 NicoHood
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
# OR OTHER DEALINGS IN THE SOFTWARE.

VERSION="1.4.1"

# Avoid any encoding problems
export LANG=C
Expand Down Expand Up @@ -255,6 +276,7 @@ while true ; do
;;
# DEPRECATED: use '--github false' or git config 'gpgit.github false'
-n|--no-github)
INTERACTIVE=false warning "Parameter '--no-github' is deprecated. Please use '--github false' instead."
GITHUB="false"
;;
-f|--force)
Expand Down Expand Up @@ -778,8 +800,13 @@ else
warning "Publishing release on default Github branch '${BRANCH}'."
fi

API_JSON="$(printf '{"tag_name": "%s","target_commitish": "%s","name": "%s","body": "%s","draft": false,"prerelease": %s}' \
"${TAG}" "${BRANCH}" "${TAG}" "${MESSAGE//$'\n'/'\n'}" "${PRERELEASE}")"
API_JSON="$(jq -n -c -M \
--arg tag_name "${TAG}" \
--arg target_commitish "${BRANCH}" \
--arg name "${TAG}" \
--arg body "${MESSAGE}" \
--argjson prerelease "${PRERELEASE}" \
'{tag_name: $tag_name, target_commitish: $target_commitish, name: $name, body: $body, draft: false, prerelease: $prerelease}')"
if ! GITHUB_RELEASE="$(curl --proto-redir =https -s --data "${API_JSON}" \
"https://github.com/gitapi/repos/${GITHUB_REPO_NAME}/releases" \
-H "Accept: application/vnd.github.v3+json" \
Expand Down

0 comments on commit 1c3301c

Please sign in to comment.