mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-05-19 13:34:19 +00:00
Compare commits
11 Commits
e8064d0439
...
d52b6ef569
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d52b6ef569 | ||
|
|
ad5d3b76db | ||
|
|
0aaab36e5f | ||
|
|
44ac16d49c | ||
|
|
e8c8b54d52 | ||
|
|
db63fd15e0 | ||
|
|
650367e88a | ||
|
|
69457e8f81 | ||
|
|
2e8171d84c | ||
|
|
16c3214862 | ||
|
|
6e1698e820 |
28
.github/workflows/check-docs.yml
vendored
Normal file
28
.github/workflows/check-docs.yml
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
name: Check Generated Docs
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
check-docs:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.0.0
|
||||
with:
|
||||
go-version-file: src/go.mod
|
||||
cache-dependency-path: src/go.sum
|
||||
|
||||
- name: Regenerate docs
|
||||
working-directory: src
|
||||
run: go run github.com/swaggo/swag/cmd/swag@v1.16.6 init --requiredByDefault
|
||||
|
||||
- name: Fail if docs are out of date
|
||||
run: |
|
||||
git diff --exit-code -- src/docs/docs.go src/docs/swagger.json src/docs/swagger.yaml
|
||||
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -8,6 +8,8 @@ on:
|
||||
branches:
|
||||
- '**' #every branch
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
runs-on: ubuntu-24.04
|
||||
@ -25,7 +27,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
needs: setup
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
- name: Login to Docker Hub
|
||||
|
||||
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
|
||||
8
.github/workflows/release-dev-version.yml
vendored
8
.github/workflows/release-dev-version.yml
vendored
@ -7,10 +7,16 @@ on:
|
||||
description: 'Version'
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
check-docs:
|
||||
uses: ./.github/workflows/check-docs.yml
|
||||
|
||||
setup:
|
||||
runs-on: ubuntu-24.04
|
||||
needs: check-docs
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
|
||||
@ -24,7 +30,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
needs: setup
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
- name: Login to Docker Hub
|
||||
|
||||
@ -7,10 +7,16 @@ on:
|
||||
description: 'Version'
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
check-docs:
|
||||
uses: ./.github/workflows/check-docs.yml
|
||||
|
||||
setup:
|
||||
runs-on: ubuntu-24.04
|
||||
needs: check-docs
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
|
||||
@ -24,7 +30,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
needs: setup
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
- name: Login to Docker Hub
|
||||
|
||||
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