Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hwittenborn committed Dec 29, 2022
0 parents commit 0aa1ab3
Show file tree
Hide file tree
Showing 44 changed files with 11,831 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
local deploy() = {
name: "publish",
kind: "pipeline",
type: "docker",
trigger: {branch: ["main"]},
steps: [
{
name: "run-tests",
image: "proget.makedeb.org/docker/makedeb/makedeb:ubuntu-kinetic",
commands: [
"sudo chown 'makedeb:makedeb' ./ -R",
".drone/scripts/run-tests.sh"
]
},

{
name: "create-release",
image: "proget.makedeb.org/docker/makedeb/makedeb:ubuntu-kinetic",
environment: {
github_api_key: {from_secret: "github_api_key"}
},
commands: [".drone/scripts/create-release.sh"]
},

{
name: "publish-mpr",
image: "proget.makedeb.org/docker/makedeb/makedeb:ubuntu-jammy",
environment: {
ssh_key: {from_secret: "ssh_key"}
},
commands: [".drone/scripts/publish-mpr.sh"]
}
]
};

[deploy()]
20 changes: 20 additions & 0 deletions .drone/scripts/create-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -ex

# Set up the PBMPR.
.drone/scripts/setup-pbmpr.sh

# Install needed dependencies.
sudo apt-get install appimage-builder gh git jq just parse-changelog -y
.drone/scripts/install-pkgbuild-deps.sh

# Create the appimage.
just create-appimage

# Create the release.
pkgver="$(just get-version)"
release_notes="$(parse-changelog CHANGELOG.md "${pkgver}")"
echo "${github_api_key}" | gh auth login --with-token
gh release create "v${pkgver}" --title "v${pkgver}" --target "${DRONE_COMMIT_SHA}" -n "${release_notes}" "celeste.AppImage#celeste-${pkgver}.AppImage"

# vim: set sw=4 expandtab:
12 changes: 12 additions & 0 deletions .drone/scripts/install-pkgbuild-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -e

cd makedeb/
cp PKGBUILD PKGBUILD.OLD

echo -e '\npackage() { true; }' >> PKGBUILD
sed -i -e 's|source=.*||' -e 's|sha256sums=.*||' PKGBUILD
makedeb -s --no-build --no-check --no-confirm

rm PKGBUILD
mv PKGBUILD.OLD PKGBUILD
31 changes: 31 additions & 0 deletions .drone/scripts/publish-mpr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -ex

sudo apt install curl jq git -y
curl -Ls "https://shlink.${hw_url}/ci-utils" | sudo bash -

mkdir ~/.ssh
echo -e "Host ${mpr_url}\n Hostname ${mpr_url}\n IdentityFile ${HOME}/.ssh/ssh_key" | tee -a "${HOME}/.ssh/config"
echo "${ssh_key}" | tee "/${HOME}/.ssh/ssh_key"

MPR_SSH_KEY="$(curl "https://${mpr_url}/api/meta" | jq -r '.ssh_key_fingerprints.ECDSA')"

SSH_HOST="${mpr_url}" \
SSH_EXPECTED_FINGERPRINT="${MPR_SSH_KEY}" \
SET_PERMS=true \
get-ssh-key

cd makedeb/
source PKGBUILD

git clone "ssh://mpr@${mpr_url}/${pkgname}"
cp PKGBUILD mist.postinst "${pkgname}/"
cd "${pkgname}/"

git config --global user.name 'Kavplex Bot'
git config --global user.email '[email protected]'

makedeb --print-srcinfo | tee .SRCINFO
git add .
git commit -m "Bump version to '${pkgver}-${pkgrel}'"
git push
10 changes: 10 additions & 0 deletions .drone/scripts/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -ex

.drone/scripts/setup-pbmpr.sh
.drone/scripts/install-pkgbuild-deps.sh

cargo fmt --check
cargo clippy -- -D warnings

# vim: set sw=4 expandtab:
4 changes: 4 additions & 0 deletions .drone/scripts/setup-pbmpr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
curl -q 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null
echo "deb [signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list
sudo apt-get update
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/AppDir
/AppDir.squashfs
/celeste.AppImage
/celeste.AppImage.zsync
/appimage-build
/target
/style.css
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.0] - 2022-12-28
First release! 🥳
Loading

0 comments on commit 0aa1ab3

Please sign in to comment.