Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ max_line_length = 80

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
75 changes: 75 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Deploy repositories

on:
push:
branches: ["main"]
workflow_dispatch:

jobs:
create-repo:
runs-on: ubuntu-latest

strategy:
matrix:
repository:
- name: APT


name: "Build ${{ matrix.repository.name }}"

steps:
- uses: actions/checkout@v5

- uses: actions/setup-python@v6
with:
python-version: "3.x"

- run: |
pip install kosmorro

- run: |
sudo apt update
sudo apt install ronn dpkg fakeroot aptly

# Start instructions specific to APT repositories

- if: ${{ matrix.repository.name }} == "APT"
env:
DEBPKG_PRIVKEY: ${{ secrets.DEBPKG_PRIVKEY }}
run: |
echo "${{ env.DEBPKG_PRIVKEY }}" > key.asc
gpg --import key.asc
rm key.asc

- if: ${{ matrix.repository.name }} == "APT"
env:
DEBPKG_KEY_ID: ${{ secrets.DEBPKG_KEY_ID }}
run: make repos

# End instructions specific to APT repositories

- if: ${{ matrix.repository.name }} != "APT"
run: make repos

- id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: repos


deploy:
name: "Deploy"
runs-on: ubuntu-latest
needs: create-repo

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.deb
/repos/

38 changes: 38 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,25 @@ SKYFIELD_DATA_VERSION ?= $(shell pip show skyfield-data | grep Version | awk '{p
KOSMORROLIB_VERSION ?= $(shell pip show kosmorrolib | grep Version | awk '{print $$2}')
KOSMORRO_VERSION ?= $(shell pip show kosmorro | grep Version | awk '{print $$2}')

DEBPKG_KEY_ID ?= ""


clean:
rm -rf *.deb

aptly publish drop main || true
aptly snapshot drop main || true
aptly repo drop main || true

rm -rf ~/.aptly/public/
rm -rf main repos


packages: deb


repos: packages repo-apt


#######################
### DEBIAN PACKAGES ###
Expand All @@ -14,6 +29,29 @@ clean:
.PHONY: deb
deb: python3-skyfield-data.deb python3-kosmorrolib.deb kosmorro.deb


repo-apt:
mkdir main && mv *.deb main
aptly repo create main
aptly repo add main main/
aptly snapshot create main from repo main
mkdir -p ~/.aptly/public
aptly publish snapshot --architectures=all --distribution=main --gpg-key="$(DEBPKG_KEY_ID)" main

rm -rf repos/apt

mkdir -p repos
cp -r ~/.aptly/public repos/apt
mv repos/apt/dists/main repos/apt/dists/stable

# Clean:
aptly publish drop main
aptly snapshot drop main
aptly repo drop main

rm -rf main


python3-skyfield-data.deb:
mkdir -p skyfield-data-deb/DEBIAN
mkdir -p skyfield-data-deb/usr/bin
Expand Down
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Kosmorro repositories

This repository contains recipes to build and publish packages and repositories for various Linux distributions.

It provides the following packages:

- [`kosmorro`](https://kosmorro.space)
- [`kosmorrolib`](https://kosmorro.space/lib)
- [`skyfield-data`](https://pypi.org/project/skyfield-data)

## Using the repositories

See the instructions specific at your distribution on [Kosmorro's website](https://kosmorro.space/cli/download/linux).

## Build packages

If you prefer, you can also build the packages by yourselves:

### DEB (Debian, Ubuntu, Linux Mint)

First, install the `dpkg-dev` and `fakeroot` packages.
Then, run the following command:

```bash
make deb
```