Skip to content

v2.4.0

v2.4.0 #26

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python package
on:
workflow_dispatch:
release:
types: [published]
jobs:
build-win:
runs-on: "windows-latest"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
pip install -r requirements.txt
python -m pip install pyinstaller
- name: run pyinstaller for seestar_alp
id: create_seestar_alp
run: |
$git_version = $(git describe --tags --always --dirty --exclude='*[0-9]-g*' --match='v*')
echo $git_version > ./version.txt
pyinstaller --name="seestar_alp" `
--add-data="device/config.toml.example;." --add-data="./version.txt;." --add-data="front/citation;astroquery" --add-data="front/templates;front/templates" --add-data="front/public;front/public" `
--add-data="front/planning.json.example;." --add-data="front/csc_sites.json;." --add-data="data/de440s.bsp;data/de440s.bsp" `
--paths=./front --paths=./device `
--collect-all=geomag `
root_app.py
Compress-Archive -Path ./dist/seestar_alp/* -DestinationPath win_seestar_alp.zip
echo "device_script_result=win_seestar_alp.zip" >> $env:GITHUB_ENV
echo "device_script_version=$(echo $git_version)" >> $env:GITHUB_ENV
if ($git_version -match ".*[0-9]-g.*") {
echo "device_script_prerelease=true" >> $env:GITHUB_ENV
} else {
echo "device_script_prerelease=false" >> $env:GITHUB_ENV
}
shell: pwsh
- name: Display Result
run: echo "The script result is ${{ env.device_script_result }}"
shell: pwsh
- name: Upload Result as Asset
uses: softprops/action-gh-release@v2
with:
files: ${{ env.device_script_result }}
tag_name: ${{ env.device_script_version }}
prerelease: ${{ env.device_script_prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-linux:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
pip install -r requirements.txt
python -m pip install pyinstaller
- name: run pyinstaller for device
id: create_device
run: |
git_version=$(git describe --tags --always --dirty --exclude='*[0-9]-g*' --match='v*')
echo $git_version > ./version.txt
pyinstaller --name="seestar_alp" \
--add-data="device/config.toml.example:." --add-data="./version.txt:." --add-data="front/CITATION:astroquery" --add-data="front/templates:front/templates" --add-data="front/public:front/public" \
--add-data="front/planning.json.example:." --add-data="front/csc_sites.json:." --add-data="data/de440s.bsp:data/de440s.bsp" \
--paths=./front --paths=./device \
--collect-all=geomag \
root_app.py
cd dist
zip -r ../linux_seestar_alp.zip ./seestar_alp/*
echo "device_script_result=linux_seestar_alp.zip" >> $GITHUB_ENV
echo "device_script_version=$(echo $git_version)" >> $GITHUB_ENV
if [[ $git_version =~ .*[0-9]*-g.* ]]; then
echo "device_script_prerelease=true" >> $GITHUB_ENV
else
echo "device_script_prerelease=false" >> $GITHUB_ENV
fi
shell: bash
- name: Display Result
run: |
echo "device_script_result - ${{ env.device_script_result }}"
echo "device_script_version - ${{ env.device_script_version }}"
echo "device_script_prerelease - ${{ env.device_script_prerelease }}"
shell: bash
- name: Upload Result as Asset
uses: softprops/action-gh-release@v2
with:
files: ${{ env.device_script_result }}
tag_name: ${{ env.device_script_version }}
prerelease: ${{ env.device_script_prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# build-MacOS:
# runs-on: "MacOS-latest"
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python 3.12
# uses: actions/setup-python@v3
# with:
# python-version: 3.12
#
# - name: Install dependencies
# run: |
# pip install -r requirements.txt
# python -m pip install pyinstaller
#
#
# - name: run pyinstaller for device
# id: create_device
# run: |
# cp ./device/config.py ./front
# cp ./device/config.toml.example ./front
# cp ./device/log.py ./front
# pyinstaller --name="seestar_alp" --hidden-import tzlocal --hidden-import geocoder --hidden-import alpaca.telescope --hidden-import log --hidden-import toml \
# --add-data="front/config.toml.example:." --add-data="front/config.py:." --add-data="front/log.py:." \
# --add-data="front/CITATION:astroquery" --add-data="front/templates:templates" --add-data="front/public:public" \
# --add-data="front:front" --add-data="device:device" root_app.py
# cd dist
# zip -r ../MacOS_seestar_alp.zip ./seestar_alp/*
# echo "device_script_result=MacOS_seestar_alp.zip" >> $GITHUB_ENV
# shell: bash
#
# - name: Display Result
# run: echo "The script result is ${{ env.device_script_result }}"
# shell: bash
#
# - name: Upload Result as Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: ${{ env.device_script_result }}
# asset_name: ${{ env.device_script_result }}
# asset_content_type: application/zip