Skip to content

Commit c3a9757

Browse files
committed
Add APT repo
1 parent 9503352 commit c3a9757

5 files changed

Lines changed: 148 additions & 0 deletions

File tree

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ max_line_length = 80
1717

1818
[*.md]
1919
trim_trailing_whitespace = false
20+
21+
[*.yml]
22+
indent_size = 2

.github/workflows/publish.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Deploy repositories
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
workflow_dispatch:
9+
10+
jobs:
11+
create-repo:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
repository:
17+
- name: APT
18+
19+
20+
name: "Build ${{ matrix.repository.name }}"
21+
22+
permissions:
23+
pages: write
24+
id-token: write
25+
contents: read
26+
27+
steps:
28+
- uses: actions/checkout@v5
29+
30+
- uses: actions/setup-python@v6
31+
with:
32+
python-version: "3.x"
33+
34+
- run: |
35+
pip install kosmorro
36+
37+
- run: |
38+
sudo apt update
39+
sudo apt install ronn dpkg fakeroot aptly
40+
41+
# Start instructions specific to APT repositories
42+
43+
- if: ${{ matrix.repository.name }} == "APT"
44+
env:
45+
DEBPKG_PRIVKEY: ${{ secrets.DEBPKG_PRIVKEY }}
46+
run: |
47+
echo "${{ env.DEBPKG_PRIVKEY }}" > key.asc
48+
gpg --import key.asc
49+
rm key.asc
50+
51+
- if: ${{ matrix.repository.name }} == "APT"
52+
env:
53+
DEBPKG_KEY_ID: ${{ secrets.DEBPKG_KEY_ID }}
54+
run: make repos
55+
56+
# End instructions specific to APT repositories
57+
58+
- if: ${{ matrix.repository.name }} != "APT"
59+
run: make repos
60+
61+
- id: deployment
62+
uses: actions/upload-pages-artifact@v3
63+
with:
64+
path: repos
65+
66+
67+
deploy:
68+
name: "Deploy"
69+
runs-on: ubuntu-latest
70+
needs: create-repo
71+
72+
environment:
73+
name: github-pages
74+
url: ${{ steps.deployment.outputs.page_url }}
75+
76+
steps:
77+
- id: deployment
78+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
*.deb
2+
/repos/
3+

Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,25 @@ SKYFIELD_DATA_VERSION ?= $(shell pip show skyfield-data | grep Version | awk '{p
22
KOSMORROLIB_VERSION ?= $(shell pip show kosmorrolib | grep Version | awk '{print $$2}')
33
KOSMORRO_VERSION ?= $(shell pip show kosmorro | grep Version | awk '{print $$2}')
44

5+
DEBPKG_KEY_ID ?= ""
6+
57

68
clean:
79
rm -rf *.deb
810

11+
aptly publish drop main || true
12+
aptly snapshot drop main || true
13+
aptly repo drop main || true
14+
15+
rm -rf ~/.aptly/public/
16+
rm -rf main repos
17+
18+
19+
packages: deb
20+
21+
22+
repos: packages repo-apt
23+
924

1025
#######################
1126
### DEBIAN PACKAGES ###
@@ -14,6 +29,30 @@ clean:
1429
.PHONY: deb
1530
deb: python3-skyfield-data.deb python3-kosmorrolib.deb kosmorro.deb
1631

32+
33+
repo-apt:
34+
mkdir main && mv *.deb main
35+
aptly repo create main
36+
aptly repo add main main/
37+
aptly snapshot create main from repo main
38+
mkdir -p ~/.aptly/public
39+
gpg --armor --output ~/.aptly/public/gpg --export $(DEBPKG_KEY_ID)
40+
aptly publish snapshot --architectures=all --distribution=main --gpg-key="$(DEBPKG_KEY_ID)" main
41+
42+
rm -rf repos/apt
43+
44+
mkdir -p repos
45+
cp -r ~/.aptly/public repos/apt
46+
mv repos/apt/dists/main repos/apt/dists/stable
47+
48+
# Clean:
49+
aptly publish drop main
50+
aptly snapshot drop main
51+
aptly repo drop main
52+
53+
rm -rf main
54+
55+
1756
python3-skyfield-data.deb:
1857
mkdir -p skyfield-data-deb/DEBIAN
1958
mkdir -p skyfield-data-deb/usr/bin

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Kosmorro repositories
2+
3+
This repository contains recipes to build and publish packages and repositories for various Linux distributions.
4+
5+
It provides the following packages:
6+
7+
- [`kosmorro`](https://kosmorro.space)
8+
- [`kosmorrolib`](https://kosmorro.space/lib)
9+
- [`skyfield-data`](https://pypi.org/project/skyfield-data)
10+
11+
## Using the repositories
12+
13+
See the instructions specific at your distribution on [Kosmorro's website](https://kosmorro.space/cli/download/linux).
14+
15+
## Build packages
16+
17+
If you prefer, you can also build the packages by yourselves:
18+
19+
### DEB (Debian, Ubuntu, Linux Mint)
20+
21+
First, install the `dpkg-dev` and `fakeroot` packages.
22+
Then, run the following command:
23+
24+
```bash
25+
make deb
26+
```

0 commit comments

Comments
 (0)