Skip to content

Commit c88a0d6

Browse files
committed
make: Prefix GH_ vars with YS_
1 parent 68508eb commit c88a0d6

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ ifndef d
181181
endif
182182

183183
release-yamlscript:
184-
ifndef GH_TOKEN
185-
$(error YAMLScript release requires GH_TOKEN to be set)
184+
ifndef YS_GH_TOKEN
185+
$(error YAMLScript release requires YS_GH_TOKEN to be set)
186186
endif
187187
(time $(ROOT)/util/release-yamlscript $o $n $s) 2>&1 | \
188188
tee -a $(RELEASE_LOG)

julia/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ deps::
1818
$(JULIA) --project=. -e 'using Pkg; Pkg.add("JSON")'
1919

2020
release:
21-
ifndef GH_TOKEN
22-
$(error GH_TOKEN not found)
21+
ifndef YS_GH_TOKEN
22+
$(error YS_GH_TOKEN not found)
2323
endif
2424
curl -L -X POST \
2525
-H "Accept: application/vnd.github+json" \
26-
-H "Authorization: Bearer $(GH_TOKEN)" \
26+
-H "Authorization: Bearer $(YS_GH_TOKEN)" \
2727
-H "X-GitHub-Api-Version: 2022-11-28" \
2828
$(YS_GH_API_URL)/commits/$(HEAD_COMMIT)/comments \
2929
-d '{"body":"@JuliaRegistrator register subdir=julia\n"}'

util/release-assets

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ setup() {
7373
RELEASE_TAR_PATH=${1:?Usage: $0 <yamlscript-release-tar-file>}
7474
RELEASE_TAR_FILE=$(basename "$RELEASE_TAR_PATH")
7575

76-
GH_REPO_USER=yaml
77-
GH_REPO=yamlscript
78-
GH_USER=${GH_USER:-$(git hub config login)}
79-
GH_TOKEN=${GH_TOKEN:-$(git hub config api-token)}
80-
GH_TARGET=main
76+
YS_GH_REPO_USER=yaml
77+
YS_GH_REPO=yamlscript
78+
YS_GH_USER=${YS_GH_USER:-$(git hub config login)}
79+
YS_GH_TOKEN=${YS_GH_TOKEN:-$(git hub config api-token)}
80+
YS_GH_TARGET=main
8181

82-
[[ $GH_USER && $GH_TOKEN ]] ||
83-
die "Error: GH_USER and GH_TOKEN must be set in the environment."
82+
[[ $YS_GH_USER && $YS_GH_TOKEN ]] ||
83+
die "Error: YS_GH_USER and YS_GH_TOKEN must be set in the environment."
8484

8585
if [[ $RELEASE_TAR_FILE == libyamlscript-* ]]; then
8686
VERSION=${RELEASE_TAR_FILE#libyamlscript-}
@@ -91,8 +91,8 @@ setup() {
9191
fi
9292
VERSION=${VERSION%%-*}
9393

94-
GH_API_PATH=repos/$GH_REPO_USER/$GH_REPO/releases
95-
GH_API_URL=https://api.github.com/$GH_API_PATH
94+
YS_GH_API_PATH=repos/$YS_GH_REPO_USER/$YS_GH_REPO/releases
95+
YS_GH_API_URL=https://api.github.com/$YS_GH_API_PATH
9696

9797
id=${RELEASE_ID-}
9898
}
@@ -112,12 +112,12 @@ api-new-release() {
112112
resp_json=$(
113113
set -x
114114
curl -s -S -L \
115-
--user "$GH_USER:$GH_TOKEN" \
115+
--user "$YS_GH_USER:$YS_GH_TOKEN" \
116116
-X POST \
117-
"$GH_API_URL" \
117+
"$YS_GH_API_URL" \
118118
-d "{
119119
\"tag_name\": \"$VERSION\",
120-
\"target_commitish\": \"$GH_TARGET\",
120+
\"target_commitish\": \"$YS_GH_TARGET\",
121121
\"name\": \"$VERSION\",
122122
\"body\": $body,
123123
\"draft\": false,
@@ -143,9 +143,9 @@ api-get-release() {
143143
resp_json=$(
144144
set -x
145145
curl -s -S -L \
146-
--user "$GH_USER:$GH_TOKEN" \
146+
--user "$YS_GH_USER:$YS_GH_TOKEN" \
147147
-X GET \
148-
"$GH_API_URL/tags/$VERSION"
148+
"$YS_GH_API_URL/tags/$VERSION"
149149
)
150150

151151
error=$(jq -r '.errors[0]' <<<"$resp_json")
@@ -161,13 +161,13 @@ api-get-release() {
161161
}
162162

163163
api-upload-assets() (
164-
GH_ASSET_URL=https://uploads.github.com/$GH_API_PATH/
165-
GH_ASSET_URL+="$id/assets?name=$RELEASE_TAR_FILE"
164+
YS_GH_ASSET_URL=https://uploads.github.com/$YS_GH_API_PATH/
165+
YS_GH_ASSET_URL+="$id/assets?name=$RELEASE_TAR_FILE"
166166
resp_json=$(
167167
set -x
168168
curl -s -S -L \
169-
--user "$GH_USER:$GH_TOKEN" \
170-
-X POST "$GH_ASSET_URL" \
169+
--user "$YS_GH_USER:$YS_GH_TOKEN" \
170+
-X POST "$YS_GH_ASSET_URL" \
171171
--header 'Content-Type: text/javascript' \
172172
--upload-file "$RELEASE_TAR_PATH"
173173
)

0 commit comments

Comments
 (0)