mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
release: github token from env var
This commit is contained in:
@@ -10959,6 +10959,7 @@ Create a release:
|
|||||||
....
|
....
|
||||||
git clone https://github.com/cirosantilli/linux-kernel-module-cheat linux-kernel-module-cheat-release
|
git clone https://github.com/cirosantilli/linux-kernel-module-cheat linux-kernel-module-cheat-release
|
||||||
cd linux-kernel-module-cheat-release
|
cd linux-kernel-module-cheat-release
|
||||||
|
# export LKMC_GITHUB_TOKEN=<your-token>
|
||||||
./release
|
./release
|
||||||
....
|
....
|
||||||
|
|
||||||
@@ -11000,13 +11001,14 @@ which you can then upload somewhere.
|
|||||||
For example, you can create or update a GitHub release and upload automatically with:
|
For example, you can create or update a GitHub release and upload automatically with:
|
||||||
|
|
||||||
....
|
....
|
||||||
git push
|
# export LKMC_GITHUB_TOKEN=<your-token>
|
||||||
printf "$GITHUB_TOKEN" > "$(./getvar github_token_file)"
|
|
||||||
./release-upload
|
./release-upload
|
||||||
....
|
....
|
||||||
|
|
||||||
Source: link:release-upload[]
|
Source: link:release-upload[]
|
||||||
|
|
||||||
|
Create `LKMC_GITHUB_TOKEN` under: https://github.com/settings/tokens/new and save it to your `.bashrc`.
|
||||||
|
|
||||||
TODO: generalize that so that people can upload to their forks.
|
TODO: generalize that so that people can upload to their forks.
|
||||||
|
|
||||||
=== Fairy tale
|
=== Fairy tale
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ extract_vmlinux = os.path.join(linux_src_dir, 'scripts', 'extract-vmlinux')
|
|||||||
qemu_src_dir = os.path.join(submodules_dir, 'qemu')
|
qemu_src_dir = os.path.join(submodules_dir, 'qemu')
|
||||||
parsec_benchmark_src_dir = os.path.join(submodules_dir, 'parsec-benchmark')
|
parsec_benchmark_src_dir = os.path.join(submodules_dir, 'parsec-benchmark')
|
||||||
ccache_dir = os.path.join('/usr', 'lib', 'ccache')
|
ccache_dir = os.path.join('/usr', 'lib', 'ccache')
|
||||||
github_token_file = os.path.join(data_dir, 'github-token')
|
|
||||||
arch_map = {
|
arch_map = {
|
||||||
'a': 'arm',
|
'a': 'arm',
|
||||||
'A': 'aarch64',
|
'A': 'aarch64',
|
||||||
@@ -236,9 +235,7 @@ def github_make_request(
|
|||||||
headers = {'Accept': 'application/vnd.github.v3+json'}
|
headers = {'Accept': 'application/vnd.github.v3+json'}
|
||||||
headers.update(extra_headers)
|
headers.update(extra_headers)
|
||||||
if authenticate:
|
if authenticate:
|
||||||
with open(this.github_token_file, 'r') as f:
|
headers['Authorization'] = 'token ' + os.environ['LKMC_GITHUB_TOKEN']
|
||||||
token = f.read().rstrip()
|
|
||||||
headers['Authorization'] = 'token ' + token
|
|
||||||
if url_params is not None:
|
if url_params is not None:
|
||||||
path += '?' + urllib.parse.urlencode(url_params)
|
path += '?' + urllib.parse.urlencode(url_params)
|
||||||
request = urllib.request.Request(
|
request = urllib.request.Request(
|
||||||
|
|||||||
1
release
1
release
@@ -26,7 +26,6 @@ start_time = time.time()
|
|||||||
subprocess.check_call([os.path.join(common.root_dir, 'configure'), '--all'])
|
subprocess.check_call([os.path.join(common.root_dir, 'configure'), '--all'])
|
||||||
subprocess.check_call([os.path.join(common.root_dir, 'build-all')])
|
subprocess.check_call([os.path.join(common.root_dir, 'build-all')])
|
||||||
release_zip.main()
|
release_zip.main()
|
||||||
subprocess.check_call(['git', 'tag', common.sha])
|
|
||||||
subprocess.check_call(['git', 'push'])
|
subprocess.check_call(['git', 'push'])
|
||||||
release_upload.main()
|
release_upload.main()
|
||||||
end_time = time.time()
|
end_time = time.time()
|
||||||
|
|||||||
Reference in New Issue
Block a user