Skip to content

Commit

Permalink
0.9.0 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
k0gen committed Oct 25, 2024
1 parent 5a76544 commit 971024b
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 17 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/buildService.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,21 @@ jobs:
uses: Start9Labs/sdk@v1

- name: Checkout services repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build the service package
id: build
run: |
git submodule update --init --recursive
start-sdk init
make
PACKAGE_ID=$(yq e ".id" manifest.yaml)
mv ${PACKAGE_ID}*s9pk ~/
PACKAGE_ID=$(yq -oy ".id" manifest.*)
echo "package_id=$PACKAGE_ID" >> $GITHUB_ENV
printf "\n SHA256SUM: $(sha256sum ${PACKAGE_ID}.s9pk) \n"
shell: bash

- name: Upload .s9pk
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE_ID }}.s9pk
path: ~/*.s9pk
name: ${{ env.package_id }}.s9pk
path: ./${{ env.package_id }}.s9pk
69 changes: 69 additions & 0 deletions .github/workflows/releaseService.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release Service

on:
push:
tags:
- 'v*.*'

jobs:
ReleasePackage:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Prepare StartOS SDK
uses: Start9Labs/sdk@v1

- name: Checkout services repository
uses: actions/checkout@v4

- name: Build the service package
run: |
git submodule update --init --recursive
start-sdk init
make
- name: Setting package ID and title from the manifest
id: package
run: |
echo "package_id=$(yq -oy ".id" manifest.*)" >> $GITHUB_ENV
echo "package_title=$(yq -oy ".title" manifest.*)" >> $GITHUB_ENV
shell: bash

- name: Generate sha256 checksum
run: |
PACKAGE_ID=${{ env.package_id }}
printf "\n SHA256SUM: $(sha256sum ${PACKAGE_ID}.s9pk) \n"
sha256sum ${PACKAGE_ID}.s9pk > ${PACKAGE_ID}.s9pk.sha256
shell: bash

- name: Generate changelog
run: |
PACKAGE_ID=${{ env.package_id }}
echo "## What's Changed" > change-log.txt
yq -oy '.release-notes' manifest.* >> change-log.txt
echo "## SHA256 Hash" >> change-log.txt
echo '```' >> change-log.txt
sha256sum ${PACKAGE_ID}.s9pk >> change-log.txt
echo '```' >> change-log.txt
shell: bash

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ env.package_title }} ${{ github.ref_name }}
prerelease: true
body_path: change-log.txt

- name: Publish to Registry
env:
S9USER: ${{ secrets.S9USER }}
S9PASS: ${{ secrets.S9PASS }}
S9REGISTRY: ${{ secrets.S9REGISTRY }}
run: |
if [[ -z "$S9USER" || -z "$S9PASS" || -z "$S9REGISTRY" ]]; then
echo "Publish skipped: missing registry credentials."
else
start-sdk publish https://$S9USER:$S9PASS@$S9REGISTRY ${{ env.package_id }}.s9pk
fi
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM docker.io/library/rust:1-bookworm as builder
FROM docker.io/library/rust:1-bookworm AS builder
RUN apt-get update && \
apt-get install -y cmake protobuf-compiler && \
rm -rf /var/lib/apt/lists/*
RUN USER=root cargo install cargo-auditable
RUN USER=root cargo new --bin nostr-rs-relay
WORKDIR ./nostr-rs-relay
WORKDIR /nostr-rs-relay
COPY ./nostr-rs-relay/Cargo.toml ./Cargo.toml
COPY ./nostr-rs-relay/Cargo.lock ./Cargo.lock
# build dependencies only (caching)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ clean:
rm -f scripts/*.js

scripts/embassy.js: $(TS_FILES)
deno bundle scripts/embassy.ts scripts/embassy.js
deno run --allow-read --allow-write --allow-env --allow-net scripts/bundle.ts

docker-images/aarch64.tar: Dockerfile docker_entrypoint.sh
ifeq ($(ARCH),x86_64)
Expand Down
14 changes: 8 additions & 6 deletions manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
id: nostr
title: "Nostr RS Relay"
version: 0.8.13
version: 0.9.0
release-notes: |
* Switch from OpenSSL to Rustls
* Update dependencies
* Fix panic on malformed signature
* Extend authz to NIP-44 and NIP-59 events
* Standardized and optimized icon
* Upstream code update
* Code cleanup and fixes
* Update bundling process to use Deno emit module
license: MIT
wrapper-repo: "https://github.com/Start9Labs/nostr-rs-relay-startos"
upstream-repo: "https://sr.ht/~gheartsfield/nostr-rs-relay/"
Expand All @@ -28,6 +26,10 @@ main:
args: []
mounts:
main: /data
hardware-requirements:
arch:
- x86_64
- aarch64
health-checks:
main:
name: Websocket Server
Expand Down
2 changes: 1 addition & 1 deletion nostr-rs-relay
Submodule nostr-rs-relay updated from 26f296 to ff65ec
6 changes: 6 additions & 0 deletions scripts/bundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// scripts/bundle.ts
import { bundle } from "https://deno.land/x/emit@0.40.0/mod.ts";

const result = await bundle("scripts/embassy.ts");

await Deno.writeTextFile("scripts/embassy.js", result.code);
2 changes: 1 addition & 1 deletion scripts/procedures/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ export const migration: T.ExpectedExports.migration = compat.migrations
),
},
},
"0.8.13",
"0.9.0",
);

0 comments on commit 971024b

Please sign in to comment.