Skip to content

Commit 9bccf13

Browse files
authored
Merge pull request #18 from ba32107/add_signkey_env_var
Add SIGN_KEY environment variable to choose GPG signing key
2 parents 277dc65 + 3b5e1af commit 9bccf13

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ linuxdeploy-plugin-appimage can be configured using environment variables.
3535

3636
- `UPDATE_INFORMATION="..."`: embed [update information](https://github.com/AppImage/AppImageSpec/blob/master/draft.md#update-information) in the AppImage, and generate corresponding `.zsync` file
3737
- `SIGN=1`: set this variable to any value to enable signing of the AppImage
38+
- `SIGN_KEY=key_id`: GPG Key ID to use for signing. This environment variable is only used if `SIGN` is set.
3839
- `VERBOSE=1`: set this variable to any value to enable verbose output
3940
- `OUTPUT=filename`: change filename of resulting AppImage

src/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ int main(const int argc, const char* const* const argv) {
113113

114114
if (getenv("SIGN") != nullptr) {
115115
args.push_back(strdup("-s"));
116+
117+
const char* signingKey;
118+
if ((signingKey = getenv("SIGN_KEY")) != nullptr) {
119+
args.push_back(strdup("--sign-key"));
120+
args.push_back(strdup(signingKey));
121+
}
116122
}
117123

118124
if (getenv("VERBOSE") != nullptr) {

0 commit comments

Comments
 (0)