This repository has been archived by the owner on Oct 10, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More improvements to Raspbian image generation #skip_ci
- Loading branch information
Showing
5 changed files
with
138 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python3 | ||
import requests | ||
import os | ||
from github import Github | ||
|
||
workdir = os.path.abspath(os.path.dirname(__file__)) | ||
print(workdir) | ||
|
||
with open(os.path.join(workdir, 'pi-gen/deploy/astrophotoplus.version'), 'r') as f: | ||
astrophotoplus_version = f.readline().strip() | ||
|
||
release_file = [f for f in os.listdir(os.path.join(workdir, 'pi-gen/deploy')) if f.endswith('AstroPhoto-Plus-{}.zip'.format(astrophotoplus_version))] | ||
if not release_file: | ||
raise RuntimeError('Zip file for AstroPhoto Plus version {} not found'.format(astrophotoplus_version)) | ||
release_file = release_file[0] | ||
|
||
print('Pushing {} to {}'.format(release_file, astrophotoplus_version)) | ||
|
||
github = Github(os.environ['GITHUB_OAUTH_USER'], os.environ['GITHUB_OAUTH_TOKEN']) | ||
repo = github.get_repo('GuLinux/AstroPhoto-Plus') | ||
release = repo.get_release('v{}'.format(astrophotoplus_version)) | ||
print('Release found, uploading asset...') | ||
release.upload_asset(os.path.join(workdir, 'pi-gen/deploy', release_file), 'Raspberry Pi Image') | ||
print('Done.') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
mv -v "${ROOTFS_DIR}/tmp/astrophotoplus.version" ../../deploy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters