mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-09-23 06:39:14 +00:00
Compare commits
5 Commits
4f9b0d0f20
...
a860dba61b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a860dba61b | ||
|
|
d258f01d59 | ||
|
|
b13a74f43e | ||
|
|
be0842fdb2 | ||
|
|
6e1698e820 |
37
.github/workflows/deploy-pages.yml
vendored
Normal file
37
.github/workflows/deploy-pages.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
name: Deploy API Docs to GitHub Pages
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v6
|
||||
|
||||
- name: Build static documentation bundle
|
||||
run: src/docs/build-static-bundle.sh site "${{ github.event.release.tag_name }}"
|
||||
|
||||
- name: Upload Pages artifact
|
||||
uses: actions/upload-pages-artifact@v5
|
||||
with:
|
||||
path: site
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v5
|
||||
23
Dockerfile
23
Dockerfile
@ -16,7 +16,7 @@ RUN dpkg-reconfigure debconf --frontend=noninteractive \
|
||||
&& apt-get update \
|
||||
&& apt-get -y install --no-install-recommends \
|
||||
wget git locales zip unzip \
|
||||
file build-essential libz-dev zlib1g-dev binutils openjdk-25-jdk \
|
||||
file build-essential libz-dev zlib1g-dev binutils \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
#COPY ext/libraries/libsignal-client/v${LIBSIGNAL_CLIENT_VERSION} /tmp/libsignal-client-libraries
|
||||
@ -40,15 +40,6 @@ ENV JAVA_OPTS="-Djdk.lang.Process.launchMechanism=vfork"
|
||||
|
||||
ENV LANG en_US.UTF-8
|
||||
|
||||
# building the jsonSchemas for armv7l unfortunately doesn't work, so as a temporary fix, do not build the json schema
|
||||
# for armv7. should be removed as soon as https://github.com/AsamK/signal-cli/pull/2040 is merged
|
||||
RUN if [ "$(uname -m)" != "armv7l" ]; then \
|
||||
cd /tmp \
|
||||
&& git clone https://github.com/AsamK/signal-cli.git --branch v${SIGNAL_CLI_VERSION} --single-branch signal-cli-source \
|
||||
&& cd signal-cli-source \
|
||||
&& ./gradlew jsonSchemas; \
|
||||
fi;
|
||||
|
||||
RUN go install github.com/swaggo/swag/cmd/swag@v${SWAG_VERSION}
|
||||
|
||||
RUN cd /tmp/ \
|
||||
@ -112,13 +103,11 @@ RUN cd /tmp/signal-cli-rest-api-src && ${GOPATH}/bin/swag init --requiredByDefau
|
||||
|
||||
|
||||
# manually add the json schemas for the receive V1 endpoint to the docs
|
||||
# (building the jsonSchemas for armv7l unfortunately doesn't work, so as a temporary fix, do not build the json schema
|
||||
# for armv7. should be removed as soon as https://github.com/AsamK/signal-cli/pull/2040 is merged)
|
||||
RUN if [ "$(uname -m)" != "armv7l" ]; then \
|
||||
cd /tmp/signal-cli-rest-api-src/docs \
|
||||
&& cp -r /tmp/signal-cli-source/build/generated/META-INF/schemas signal-cli-schemas \
|
||||
&& go run add_v1_receive_schemas.go signal-cli-schemas; \
|
||||
fi;
|
||||
RUN cd /tmp/signal-cli-rest-api-src/docs \
|
||||
&& wget https://github.com/AsamK/signal-cli/releases/download/v${SIGNAL_CLI_VERSION}/signal-cli-${SIGNAL_CLI_VERSION}-json-schemas.tar.gz \
|
||||
&& mkdir signal-cli-schemas \
|
||||
&& tar xf signal-cli-${SIGNAL_CLI_VERSION}-json-schemas.tar.gz -C signal-cli-schemas \
|
||||
&& go run add_v1_receive_schemas.go signal-cli-schemas
|
||||
|
||||
# build signal-cli-rest-api
|
||||
RUN cd /tmp/signal-cli-rest-api-src && go build -o signal-cli-rest-api main.go
|
||||
|
||||
@ -45,7 +45,7 @@ Install [go](https://go.dev/).
|
||||
cd docs
|
||||
```
|
||||
1. Add the signal-cli receive V1 schemas
|
||||
* Download the `signal-cli-x.y.z-json-schemas.tar.gz` schema files from https://github.com/Gara-Dorta/signal-cli/releases
|
||||
* Download the `signal-cli-x.y.z-json-schemas.tar.gz` schema files from https://github.com/AsamK/signal-cli/releases
|
||||
* Extract the files
|
||||
* Run the script to add the schemas
|
||||
```bash
|
||||
|
||||
24
src/docs/build-static-bundle.sh
Executable file
24
src/docs/build-static-bundle.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
DOCS_DIR="$ROOT_DIR/src/docs"
|
||||
INDEX_FILE="$DOCS_DIR/index.html"
|
||||
OUT_DIR="${1:?output directory argument is required}"
|
||||
DOCS_VERSION="${2:?docs version argument is required}"
|
||||
NORMALIZED_DOCS_VERSION="${DOCS_VERSION#v}"
|
||||
|
||||
echo "Normalized docs version: $NORMALIZED_DOCS_VERSION"
|
||||
|
||||
rm -rf "$OUT_DIR"
|
||||
mkdir -p "$OUT_DIR"
|
||||
|
||||
cp "$DOCS_DIR/swagger.json" "$OUT_DIR/swagger.json"
|
||||
cp "$INDEX_FILE" "$OUT_DIR/index.html"
|
||||
touch "$OUT_DIR/.nojekyll"
|
||||
|
||||
jq --arg version "$NORMALIZED_DOCS_VERSION" '.info.version = $version' "$OUT_DIR/swagger.json" > "$OUT_DIR/swagger.json.tmp"
|
||||
mv "$OUT_DIR/swagger.json.tmp" "$OUT_DIR/swagger.json"
|
||||
|
||||
echo "Static bundle created at: $OUT_DIR"
|
||||
@ -11,7 +11,7 @@
|
||||
window.onload = function () {
|
||||
// Begin Swagger UI call region
|
||||
const ui = SwaggerUIBundle({
|
||||
url: "src/docs/swagger.json", //Location of Open API spec in the repo
|
||||
url: "swagger.json",
|
||||
dom_id: '#swagger-ui',
|
||||
deepLinking: true,
|
||||
presets: [
|
||||
Loading…
x
Reference in New Issue
Block a user