Skip to content

Commit a4899bb

Browse files
committed
init
0 parents  commit a4899bb

26 files changed

+2218
-0
lines changed

.github/workflows/black.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Black Formatting
2+
3+
on: [push]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: psf/black@23.1.0
11+
12+
with:
13+
options: "--verbose"
14+
src: "."
15+
16+
- name: Commit Changes
17+
continue-on-error: true
18+
run: |
19+
git add .
20+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
21+
git config --local user.name "github-actions[bot]"
22+
git commit -m "Black Formatting"
23+
- name: Push changes
24+
continue-on-error: true
25+
uses: ad-m/github-push-action@master
26+
with:
27+
github_token: ${{ secrets.GITHUB_TOKEN}}
28+
branch: ${{ github.ref }}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Build and Upload test package
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- 'debian/changelog'
8+
9+
10+
11+
jobs:
12+
build:
13+
runs-on: [ self-hosted, debian-12, pkg ]
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Build packages
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get build-dep --no-install-recommends -y .
22+
sudo apt-get install --no-install-recommends -y git-buildpackage debhelper devscripts
23+
make deb
24+
25+
- name: Workaround actions
26+
run: |
27+
echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV
28+
29+
- name: Upload artifacts
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: ${{ github.event.repository.name }}
33+
path: |
34+
${{ env.artifacts_path }}/*.deb
35+
36+
release:
37+
needs: build
38+
runs-on: [ self-hosted, ubuntu-24.04, pkg ]
39+
steps:
40+
41+
- name: Install dependencies
42+
run: |
43+
sudo apt-get update
44+
sudo apt-get install -y reprepro gnupg git unzip openssh-client
45+
46+
- name: Checkout
47+
uses: actions/checkout@v4
48+
49+
- name: Checkout repo
50+
uses: actions/checkout@v4
51+
with:
52+
repository: ameridroid/apt-repo
53+
path: repo
54+
55+
- uses: actions/download-artifact@v4
56+
with:
57+
name: ${{ github.event.repository.name }}
58+
59+
- name: Extract artifacts
60+
run: |
61+
ls *.deb
62+
63+
- name: Import GPG and ssh key
64+
env:
65+
GPG_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
66+
SSH_KEY: ${{ secrets.APT_SSH_KEY }}
67+
run: |
68+
echo "$GPG_KEY" | gpg --import
69+
gpg --list-keys
70+
mkdir -p ~/.ssh
71+
echo "$SSH_KEY" > ~/.ssh/id_ed25519
72+
chmod 600 ~/.ssh/id_ed25519
73+
ssh-keyscan github.com >> ~/.ssh/known_hosts
74+
75+
- name: Upload packages to APT repository
76+
run: |
77+
cd ./repo/testing/
78+
for package in ../../*.deb; do
79+
for codename in bookworm trixie sid oracular; do
80+
reprepro --ignore=wrongdistribution includedeb $codename $package
81+
done
82+
done
83+
84+
- name: Push updated repository to main branch
85+
run: |
86+
ls
87+
cd ./repo
88+
git config --global user.name "GitHub Actions"
89+
git config --global user.email "actions@github.com"
90+
git add -A
91+
git commit -m "Update ${{ github.event.repository.name}}" || echo "No changes to commit"
92+
git remote set-url origin git@github.com:ameriDroid/apt-repo.git
93+
git push origin main
94+

.github/workflows/release.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: Build and Upload release package
2+
on:
3+
workflow_dispatch:
4+
5+
permissions:
6+
contents: write
7+
8+
jobs:
9+
build:
10+
runs-on: [ self-hosted, debian-12, pkg ]
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Build packages
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get build-dep --no-install-recommends -y .
19+
sudo apt-get install --no-install-recommends -y git-buildpackage debhelper devscripts
20+
make deb
21+
22+
- name: Workaround actions
23+
run: |
24+
echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV
25+
26+
- name: Upload artifacts
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: ${{ github.event.repository.name }}
30+
path: |
31+
${{ env.artifacts_path }}/*.deb
32+
33+
release:
34+
needs: build
35+
runs-on: [ self-hosted, ubuntu-24.04, pkg ]
36+
steps:
37+
38+
- name: Install dependencies
39+
run: |
40+
sudo apt-get update
41+
sudo apt-get install -y reprepro gnupg git unzip openssh-client
42+
43+
- name: Checkout
44+
uses: actions/checkout@v4
45+
46+
- name: Checkout repo
47+
uses: actions/checkout@v4
48+
with:
49+
repository: ameridroid/apt-repo
50+
path: repo
51+
52+
- uses: actions/download-artifact@v4
53+
with:
54+
name: ${{ github.event.repository.name }}
55+
56+
- name: Extract artifacts
57+
run: |
58+
ls *.deb
59+
60+
- name: Import GPG and ssh key
61+
env:
62+
GPG_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
63+
SSH_KEY: ${{ secrets.APT_SSH_KEY }}
64+
run: |
65+
echo "$GPG_KEY" | gpg --import
66+
gpg --list-keys
67+
mkdir -p ~/.ssh
68+
echo "$SSH_KEY" > ~/.ssh/id_ed25519
69+
chmod 600 ~/.ssh/id_ed25519
70+
ssh-keyscan github.com >> ~/.ssh/known_hosts
71+
72+
- name: Upload packages to APT repository
73+
run: |
74+
cd ./repo/stable/
75+
for package in ../../*.deb; do
76+
for codename in bookworm trixie sid oracular; do
77+
reprepro --ignore=wrongdistribution includedeb $codename $package
78+
done
79+
done
80+
81+
- name: Push updated repository to main branch
82+
run: |
83+
cd ./repo
84+
git config --global user.name "GitHub Actions"
85+
git config --global user.email "actions@github.com"
86+
git add -A
87+
git commit -m "Update ${{ github.event.repository.name}}" || echo "No changes to commit"
88+
git remote set-url origin git@github.com:ameriDroid/apt-repo.git
89+
git push origin main
90+
91+
- name: Release notes
92+
run: |
93+
version="$(dpkg-parsechangelog -S Version)"
94+
# replace ~ with - to match tag format
95+
version="${version//\~/\-}"
96+
echo "version=$version" >> $GITHUB_ENV
97+
echo "changes<<EOF" >> $GITHUB_ENV
98+
echo '```' >> $GITHUB_ENV
99+
echo "$(dpkg-parsechangelog -S Changes)" >> $GITHUB_ENV
100+
echo '```' >> $GITHUB_ENV
101+
echo "EOF" >> $GITHUB_ENV
102+
103+
- name: Release
104+
uses: softprops/action-gh-release@v2.1.0
105+
with:
106+
files: |
107+
./*.deb
108+
token: ${{ secrets.GITHUB_TOKEN }}
109+
tag_name: ${{ env.version }}
110+
body: |
111+
## Changelog for ${{ env.version }}
112+
${{ env.changes }}
113+
draft: false
114+
prerelease: false
115+

0 commit comments

Comments
 (0)