Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ed1edd72e | ||
|
|
4a33d1f488 | ||
|
|
46f6d6ae19 | ||
|
|
f55bd4b68a | ||
|
|
bbcbfebc83 | ||
|
|
3db979c712 | ||
|
|
ceab864a58 | ||
|
|
b72f0e07bc |
@@ -16,14 +16,16 @@ jobs:
|
||||
- arch: x86_64
|
||||
target: x86_64-unknown-linux-gnu
|
||||
runs-on: ubuntu-latest
|
||||
sccache_dir: /sccache
|
||||
- arch: aarch64
|
||||
target: aarch64-unknown-linux-gnu
|
||||
runs-on: aarch64
|
||||
sccache_dir: /var/lib/gitea-runner/sccache
|
||||
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: builtin:checkout
|
||||
|
||||
- name: Install system dependencies
|
||||
if: matrix.arch == 'x86_64'
|
||||
@@ -36,11 +38,26 @@ jobs:
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
- name: Cache cargo registry
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cargo/registry
|
||||
key: ${{ runner.os }}-${{ matrix.arch }}-cargo-${{ hashFiles('Cargo.lock') }}
|
||||
# Compiled-crate cache via sccache. x86_64 uses /sccache (a persistent
|
||||
# host dir bind-mounted into the job container by the runner config);
|
||||
# aarch64 runs on the klokka host and uses a runner-owned dir. Both
|
||||
# persist across releases, unlike the (unreachable) Gitea cache service.
|
||||
- name: Set up sccache
|
||||
run: |
|
||||
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
|
||||
echo "SCCACHE_DIR=${{ matrix.sccache_dir }}" >> "$GITHUB_ENV"
|
||||
mkdir -p "${{ matrix.sccache_dir }}"
|
||||
if command -v sccache >/dev/null 2>&1; then sccache --version; exit 0; fi
|
||||
# Bare runners (aarch64 = klokka host) are pre-provisioned; CI must not
|
||||
# install onto them (and this tarball is x86_64-only). Only the
|
||||
# ephemeral x86_64 container installs; a bare host missing it fails loud.
|
||||
if [ "${{ matrix.arch }}" != x86_64 ]; then
|
||||
echo "::error::sccache missing on the bare ${{ matrix.arch }} runner — provision klokka; CI must not install on bare hosts"; exit 1
|
||||
fi
|
||||
V=0.8.2
|
||||
curl -sSL "https://github.com/mozilla/sccache/releases/download/v${V}/sccache-v${V}-x86_64-unknown-linux-musl.tar.gz" | tar -xz
|
||||
sudo install -m0755 "sccache-v${V}-x86_64-unknown-linux-musl/sccache" /usr/local/bin/sccache
|
||||
sccache --version
|
||||
|
||||
- name: Test
|
||||
run: cargo test --target ${{ matrix.target }}
|
||||
@@ -63,7 +80,7 @@ jobs:
|
||||
- name: Create release
|
||||
run: |
|
||||
curl -sX POST \
|
||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases" \
|
||||
-d "{\"tag_name\":\"${{ gitea.ref_name }}\",\"name\":\"${{ gitea.ref_name }}\"}" \
|
||||
@@ -72,24 +89,24 @@ jobs:
|
||||
- name: Upload assets
|
||||
run: |
|
||||
RELEASE_ID=$(curl -s \
|
||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/tags/${{ gitea.ref_name }}" \
|
||||
| jq -r '.id')
|
||||
|
||||
for FILE in "${{ env.TARBALL }}" "${{ env.TARBALL }}.sha256"; do
|
||||
# Remove any existing asset with the same name so re-runs stay clean
|
||||
EXISTING=$(curl -s \
|
||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets" \
|
||||
| jq -r ".[] | select(.name == \"${FILE}\") | .id")
|
||||
for AID in $EXISTING; do
|
||||
curl -sX DELETE \
|
||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets/${AID}"
|
||||
done
|
||||
|
||||
curl -sX POST \
|
||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets?name=${FILE}" \
|
||||
--data-binary "@${FILE}" --fail-with-body
|
||||
@@ -100,7 +117,7 @@ jobs:
|
||||
runs-on: aarch64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: builtin:checkout
|
||||
|
||||
- name: Compute checksums and update PKGBUILD
|
||||
run: |
|
||||
@@ -113,6 +130,32 @@ jobs:
|
||||
sed -i "s/sha256sums_x86_64=('.*')/sha256sums_x86_64=('${SUM_X86}')/" aur/PKGBUILD
|
||||
sed -i "s/sha256sums_aarch64=('.*')/sha256sums_aarch64=('${SUM_AARCH}')/" aur/PKGBUILD
|
||||
|
||||
# Also publish the built packages to this instance's Arch registry
|
||||
# (docs.gitea.com/usage/packages/arch). The PKGBUILD only repacks the
|
||||
# release tarballs, so CARCH can produce both architectures from this
|
||||
# one host. Consumers: see the infrastructure README.
|
||||
# Best-effort mirror to the instance Arch registry. The ephemeral
|
||||
# GITHUB_TOKEN is not accepted as a package-write credential, so this
|
||||
# uses a dedicated REGISTRY_TOKEN secret (a write:package token for bl);
|
||||
# if it is unset the step is skipped, and continue-on-error keeps a
|
||||
# registry hiccup from failing the release or the AUR push.
|
||||
- name: Publish to the Arch package registry
|
||||
continue-on-error: true
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -z "${{ secrets.REGISTRY_TOKEN }}" ]; then
|
||||
echo "::warning::REGISTRY_TOKEN not set — skipping Arch registry publish"
|
||||
exit 0
|
||||
fi
|
||||
cd aur
|
||||
for carch in aarch64 x86_64; do
|
||||
pkgfile=$(CARCH="$carch" makepkg --packagelist | tail -1)
|
||||
CARCH="$carch" makepkg -f --nodeps --noconfirm --skipinteg
|
||||
curl --fail-with-body --user "bl:${{ secrets.REGISTRY_TOKEN }}" \
|
||||
--upload-file "$pkgfile" \
|
||||
"${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/arch/uhhm"
|
||||
done
|
||||
|
||||
- name: Push to AUR
|
||||
env:
|
||||
AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }}
|
||||
|
||||
Generated
+1
-1
@@ -243,7 +243,7 @@ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
||||
|
||||
[[package]]
|
||||
name = "orca-rs"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"crossterm",
|
||||
"midir",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "orca-rs"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
edition = "2021"
|
||||
description = "Orca live coding environment, ported to Rust"
|
||||
license = "MIT"
|
||||
|
||||
+5
-4
@@ -1,10 +1,11 @@
|
||||
# Maintainer: Bendik Aagaard Lynghaug <bendik.lynghaug@gmail.com>
|
||||
pkgname=orca-rs
|
||||
pkgver=0.1.1
|
||||
pkgver=0.1.2
|
||||
pkgrel=1
|
||||
pkgdesc="Orca live coding environment, ported to Rust (terminal UI with MIDI/OSC/UDP output)"
|
||||
arch=('x86_64' 'aarch64')
|
||||
url="https://prosjekt.klingenbergbygg.no/bl/orca-rs"
|
||||
options=('!strip')
|
||||
url="https://project.uhhm.no/bl/orca-rs"
|
||||
license=('MIT')
|
||||
depends=('alsa-lib')
|
||||
optdepends=(
|
||||
@@ -12,8 +13,8 @@ optdepends=(
|
||||
)
|
||||
provides=('orca-rs')
|
||||
conflicts=('orca-rs-git' 'orca-rs-bin')
|
||||
source_x86_64=("orca-rs-v${pkgver}-x86_64.tar.gz::https://prosjekt.klingenbergbygg.no/bl/orca-rs/releases/download/v${pkgver}/orca-rs-v${pkgver}-x86_64.tar.gz")
|
||||
source_aarch64=("orca-rs-v${pkgver}-aarch64.tar.gz::https://prosjekt.klingenbergbygg.no/bl/orca-rs/releases/download/v${pkgver}/orca-rs-v${pkgver}-aarch64.tar.gz")
|
||||
source_x86_64=("orca-rs-v${pkgver}-x86_64.tar.gz::https://project.uhhm.no/bl/orca-rs/releases/download/v${pkgver}/orca-rs-v${pkgver}-x86_64.tar.gz")
|
||||
source_aarch64=("orca-rs-v${pkgver}-aarch64.tar.gz::https://project.uhhm.no/bl/orca-rs/releases/download/v${pkgver}/orca-rs-v${pkgver}-aarch64.tar.gz")
|
||||
sha256sums_x86_64=('SKIP')
|
||||
sha256sums_aarch64=('SKIP')
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ Options:
|
||||
--midi-name <s> Connect to the MIDI output port whose name contains <s>
|
||||
instead of creating a virtual port
|
||||
--list-midi List available MIDI output ports and exit
|
||||
-V, --version Print version and exit
|
||||
-h, --help Print this message and exit
|
||||
|
||||
A default MIDI port can be set in ~/.config/orca-rs/config.toml:
|
||||
@@ -77,6 +78,10 @@ fn main() {
|
||||
}
|
||||
return;
|
||||
}
|
||||
"-V" | "--version" => {
|
||||
println!("orca-rs {}", env!("CARGO_PKG_VERSION"));
|
||||
return;
|
||||
}
|
||||
"-h" | "--help" => {
|
||||
print!("{USAGE}");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user