Skip to content

Commit f90e690

Browse files
committed
release: github token from env var
1 parent 7183fec commit f90e690

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

README.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10959,6 +10959,7 @@ Create a release:
1095910959
....
1096010960
git clone https://github.com/cirosantilli/linux-kernel-module-cheat linux-kernel-module-cheat-release
1096110961
cd linux-kernel-module-cheat-release
10962+
# export LKMC_GITHUB_TOKEN=<your-token>
1096210963
./release
1096310964
....
1096410965

@@ -11000,13 +11001,14 @@ which you can then upload somewhere.
1100011001
For example, you can create or update a GitHub release and upload automatically with:
1100111002

1100211003
....
11003-
git push
11004-
printf "$GITHUB_TOKEN" > "$(./getvar github_token_file)"
11004+
# export LKMC_GITHUB_TOKEN=<your-token>
1100511005
./release-upload
1100611006
....
1100711007

1100811008
Source: link:release-upload[]
1100911009

11010+
Create `LKMC_GITHUB_TOKEN` under: https://github.com/settings/tokens/new and save it to your `.bashrc`.
11011+
1101011012
TODO: generalize that so that people can upload to their forks.
1101111013

1101211014
=== Fairy tale

common.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
qemu_src_dir = os.path.join(submodules_dir, 'qemu')
3838
parsec_benchmark_src_dir = os.path.join(submodules_dir, 'parsec-benchmark')
3939
ccache_dir = os.path.join('/usr', 'lib', 'ccache')
40-
github_token_file = os.path.join(data_dir, 'github-token')
4140
arch_map = {
4241
'a': 'arm',
4342
'A': 'aarch64',
@@ -236,9 +235,7 @@ def github_make_request(
236235
headers = {'Accept': 'application/vnd.github.v3+json'}
237236
headers.update(extra_headers)
238237
if authenticate:
239-
with open(this.github_token_file, 'r') as f:
240-
token = f.read().rstrip()
241-
headers['Authorization'] = 'token ' + token
238+
headers['Authorization'] = 'token ' + os.environ['LKMC_GITHUB_TOKEN']
242239
if url_params is not None:
243240
path += '?' + urllib.parse.urlencode(url_params)
244241
request = urllib.request.Request(

release

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ start_time = time.time()
2626
subprocess.check_call([os.path.join(common.root_dir, 'configure'), '--all'])
2727
subprocess.check_call([os.path.join(common.root_dir, 'build-all')])
2828
release_zip.main()
29-
subprocess.check_call(['git', 'tag', common.sha])
3029
subprocess.check_call(['git', 'push'])
3130
release_upload.main()
3231
end_time = time.time()

0 commit comments

Comments
 (0)