remove rocket tls #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# - target: x86_64-apple-darwin | |
# os: macos-latest | |
# - target: aarch64-apple-darwin | |
# os: macos-latest | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
# - target: aarch64-unknown-linux-gnu | |
# os: ubuntu-latest | |
steps: | |
- name: Export GitHub Actions cache environment variables | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc-aarch64-linux-gnu | |
if: matrix.target == 'aarch64-unknown-linux-gnu' | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
target: ${{ matrix.target }} | |
override: true | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target ${{ matrix.target }} | |
- name: Extract openapi3.json | |
run: | | |
mkdir -p docs | |
target/${{ matrix.target }}/release/sctgdesk-api-server & | |
sleep 5 | |
curl http://127.0.0.1:21114/openapi.json > docs/openapi3.json | |
kill $! | |
- name: Create Rapidoc index.html | |
run: | | |
mkdir -p docs | |
cat <<EOF > docs/index.html | |
<!DOCTYPE html> | |
<!-- Important: must specify --> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<!-- Important: rapi-doc uses utf8 charecters --> | |
<script | |
type="module" | |
src="https://unpkg.com/rapidoc/dist/rapidoc-min.js" | |
></script> | |
</head> | |
<body> | |
<rapi-doc | |
spec-url="data:application/json;base64,$(base64 -w 0 docs/openapi3.json)" | |
render-style="read" | |
> | |
</rapi-doc> | |
</body> | |
</html> | |
EOF | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/ | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.target }} | |
path: target/${{ matrix.target }}/release/ |