You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, either set `MAVEN_GPG_PRIVATE_KEY_FILE` to point to `private.pem` or
118
-
export the private key to a single line where newlines are encoded as `\n`
120
+
export the private key to a single line where newlines are encoded as `\n`
119
121
and then assign it to `MAVEN_GPG_PRIVATE_KEY`:
120
122
121
123
```console
@@ -158,7 +160,7 @@ npx jsii-release-nuget [DIR]
158
160
159
161
* Set `NUGET_SERVER` to `https://nuget.pkg.github.com/(`org or user`).
160
162
* Set `NUGET_API_KEY` to a token with write packages permissions.
161
-
* Make sure the repository url in the project file matches the org or user used for the server
163
+
* Make sure the repository url in the project file matches the org or user used for the server
162
164
163
165
## PyPI
164
166
@@ -181,6 +183,33 @@ npx jsii-release-pypi [DIR]
181
183
|`TWINE_REPOSITORY_URL`|Optional|The registry URL (defaults to Twine default)|
182
184
183
185
186
+
## Golang
187
+
188
+
Pushes a directory of golang modules to a GitHub repository.
189
+
190
+
**Usage:**
191
+
192
+
```shell
193
+
npx jsii-release-golang [DIR]
194
+
```
195
+
196
+
`DIR`is a directory where the golang modules are located (default is `dist/go`). Each subdirectory inside it
197
+
must be a go module and contain a go.mod file. This directory is pushed as is to the repository root, overriding existing files.
198
+
199
+
**Options (environment variables):**
200
+
201
+
|Option|Required|Description|
202
+
|------|--------|-----------|
203
+
|`GITHUB_TOKEN`|Required|[GitHub personal access token.](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)|
204
+
|`VERSION`|Optional|Module version. Defaults to the value in the 'version' file of the module directory. Fails if it doesn't exist.|
205
+
|`GITHUB_REPO`|Optional|GitHub repository to push to. Default is derived from the module name.|
206
+
|`GIT_BRANCH`|Optional|Branch to push to. Defaults to 'main'.|
207
+
|`GIT_USER_NAME`|Optional|Username to perform the commit with. Defaults to the global git user.name config. Fails it it doesn't exist.|
208
+
|`GIT_USER_EMAIL`|Optional|Email to perform the commit with. Defaults to the global git user.email config. Fails it it doesn't exist.|
209
+
|`GIT_COMMIT_MESSAGE`|Optional|The commit message. Defaults to 'chore(release): $VERSION'.|
# Pushes a directory of golang modules to a GitHub repository.
7
+
#
8
+
# Usage: ./jsii-release-golang [DIR]
9
+
#
10
+
# DIR is a directory where the golang modules are located (default is `dist/go`). Each subdirectory inside it must be a
11
+
# go module and contain a go.mod file. This directory is pushed as is to the repository root, overriding existing files.
12
+
#
13
+
# GITHUB_TOKEN (required): Authentication token that allows to push and tag the repository.
14
+
# VERSION (optional): Module version. Defaults to the value in the 'version' file of the module directory. Fails if it doesn't exist.
15
+
# GITHUB_REPO (optional): GitHub repository to push to. Default is derived from the module name.
16
+
# GIT_BRANCH (optional): Branch to push to. Defaults to 'main'.
17
+
# GIT_USER_NAME (optional): Username to perform the commit with. Defaults to the global git user.name config. Fails it it doesn't exist.
18
+
# GIT_USER_EMAIL (optional): Email to perform the commit with. Defaults to the global git user.email config. Fails it it doesn't exist.
19
+
# GIT_COMMIT_MESSAGE (optional): The commit message. Defaults to 'chore(release): $VERSION'.
20
+
# DRYRUN (optional): Set to "true" for a dry run
21
+
###
22
+
23
+
dir=${1:-dist/go}
24
+
GIT_BRANCH=${GIT_BRANCH:-main}
25
+
26
+
# remember the full path since we might be changing dirs later on
27
+
dir="$(pwd)/${dir}"
28
+
29
+
error() { echo"❌ $@";exit 1; }
30
+
31
+
if!command -v git &> /dev/null;then
32
+
error "git must be available to run this script"
33
+
fi
34
+
35
+
if [ -z"${GIT_USER_NAME:-}" ];then
36
+
GIT_USER_NAME=$(git config user.name)|| error "Unable to detect username. either configure a global git user.name or pass GIT_USER_NAME env variable"
37
+
fi
38
+
39
+
if [ -z"${GIT_USER_EMAIL:-}" ];then
40
+
GIT_USER_EMAIL=$(git config user.email)|| error "Unable to detect user email. either configure a global git user.email or pass GIT_USER_EMAIL env variable"
41
+
fi
42
+
43
+
dry_run=false
44
+
if [[ ${DRYRUN:-"false"}="true" ]];then
45
+
echo"==========================================="
46
+
echo" 🏜️ DRY-RUN MODE 🏜️"
47
+
echo"==========================================="
48
+
dry_run=true
49
+
fi
50
+
51
+
if [ !-d${dir} ];then
52
+
error "${dir} either doesnt exist or is not a directory"
0 commit comments