Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d278df09f7 | ||
|
|
8e31da1636 | ||
|
|
e4280f7721 | ||
|
|
c2638a03ad | ||
|
|
a793c96532 | ||
|
|
1ce6dc2de1 |
@@ -0,0 +1,23 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- run: git log $(git describe --tags --abbrev=0 HEAD~1)..HEAD --oneline > changelog.txt
|
||||||
|
- uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
make_latest: true
|
||||||
|
body_path: changelog.txt
|
||||||
|
files: astrolobot.py
|
||||||
+11
-4
@@ -10,10 +10,11 @@ import json,sys,webbrowser,importlib,tomllib
|
|||||||
|
|
||||||
def update():
|
def update():
|
||||||
print('checking for updates...')
|
print('checking for updates...')
|
||||||
|
try:
|
||||||
with open(script_path()+'astrolobot.py','r') as file:
|
with open(script_path()+'astrolobot.py','r') as file:
|
||||||
current_script=file.read()
|
current_script=file.read()
|
||||||
urlretrieve(
|
urlretrieve(
|
||||||
'https://github.com/sugoidogo/astrolobot/releases/latest/download/astrolobot.py',
|
'https://gitea.sugoidogo.com/SugoiDogo/astrolobot/releases/download/latest/astrolobot.py',
|
||||||
script_path()+'astrolobot.py'
|
script_path()+'astrolobot.py'
|
||||||
)
|
)
|
||||||
with open(script_path()+'astrolobot.py','r') as file:
|
with open(script_path()+'astrolobot.py','r') as file:
|
||||||
@@ -22,12 +23,14 @@ def update():
|
|||||||
print('up to date')
|
print('up to date')
|
||||||
else:
|
else:
|
||||||
print('update downloaded, restart script to apply')
|
print('update downloaded, restart script to apply')
|
||||||
|
except:
|
||||||
|
print('update check failed, ignoring')
|
||||||
|
|
||||||
def dependency_setup():
|
def dependency_setup():
|
||||||
if not path.exists(script_path()+'pip'):
|
if not path.exists(script_path()+'pip'):
|
||||||
print('installing dependencies')
|
print('installing dependencies')
|
||||||
from pip._internal.cli.main import main as pip
|
from pip._internal.cli.main import main as pip
|
||||||
pip(['install','-qq','pyswisseph','twitch.py','--target',script_path()+'pip'])
|
pip(['install','-qq','-r',script_path()+'/requirements.txt','--target',script_path()+'pip'])
|
||||||
|
|
||||||
sys.path.append(script_path()+'pip')
|
sys.path.append(script_path()+'pip')
|
||||||
|
|
||||||
@@ -394,7 +397,11 @@ def login(*args):
|
|||||||
global device_code
|
global device_code
|
||||||
if device_code==None:
|
if device_code==None:
|
||||||
print('astrolobot is still starting, please wait',sys.stderr)
|
print('astrolobot is still starting, please wait',sys.stderr)
|
||||||
webbrowser.open('https://www.twitch.tv/activate?public=true&device-code='+device_code)
|
else:
|
||||||
|
login_url='https://www.twitch.tv/activate?public=true&device-code='+device_code
|
||||||
|
print("if your browser doesn't automatically open, go to the following url:")
|
||||||
|
print(login_url)
|
||||||
|
webbrowser.open(login_url)
|
||||||
|
|
||||||
def save_tokens(access_token,refresh_token):
|
def save_tokens(access_token,refresh_token):
|
||||||
with open(script_path()+'tokens.json','w') as file:
|
with open(script_path()+'tokens.json','w') as file:
|
||||||
@@ -463,7 +470,7 @@ def main():
|
|||||||
async def on_code(code: str):
|
async def on_code(code: str):
|
||||||
global device_code, obs_settings
|
global device_code, obs_settings
|
||||||
device_code=code
|
device_code=code
|
||||||
if obs_settings == None:
|
if len(tokens)==0:
|
||||||
login()
|
login()
|
||||||
|
|
||||||
@client.event
|
@client.event
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
pyswisseph
|
pyswisseph
|
||||||
twitch.py
|
twitch.py == 3.*
|
||||||
Reference in New Issue
Block a user