Skip to content

Commit

Permalink
Merge pull request #873 from thorium-cfx/compat-pull
Browse files Browse the repository at this point in the history
Compatibility generation (automatic, push)
  • Loading branch information
blattersturm authored Mar 26, 2023
2 parents dd3476b + a5f9035 commit fdb8fcc
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
13 changes: 9 additions & 4 deletions .ci/run-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@

set -eu

repo_root="$(pwd)"
ci_root="$(dirname "$0")"

# include common script
. "$(dirname "$0")"/common.sh
. "$ci_root"/common.sh

title "Building new documentation output...\n"

repo_root="$(pwd)"

mkdir -p out

# Native generation
pushd "$BUILDER_ROOT"
node index.js "$repo_root"
cp -a natives_test.json "$repo_root/out/natives.json"
node build-template.js lua > "$repo_root/out/natives.lua"
node build-template.js reference > "$repo_root/out/natives.html"
popd
popd

# Compatibility native generation
"$ci_root"/run-compat "$BUILDER_ROOT" "./out/natives_global_client_compat.lua" "./in/natives_global_client_compat.lua"
10 changes: 7 additions & 3 deletions .ci/setup-builder
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ sudo ln -s libclang-10.so.1 /usr/lib/x86_64-linux-gnu/libclang.so
mkdir -p $BUILDER_ROOT
cd $BUILDER_ROOT

git init -q .
git fetch -q --depth=1 https://github.com/citizenfx/native-doc-tooling.git 59821abdd96caf23be103bfa0da3c799ce690df9
git checkout FETCH_HEAD
# shallow clone latest
git clone --depth=1 https://github.com/citizenfx/native-doc-tooling.git ./

# shallow clone specific commit
#git init -q .
#git fetch -q --depth=1 https://github.com/citizenfx/native-doc-tooling.git 59821abdd96caf23be103bfa0da3c799ce690df9
#git checkout FETCH_HEAD

yarn
20 changes: 14 additions & 6 deletions .github/workflows/deploy-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,29 @@ jobs:
- uses: actions/checkout@v2
with:
path: './'
fetch-depth: 2
- uses: actions/setup-node@v2
with:
node-version: '12' # while 14+ technically works, it's 25-50x slower at running native-doc-tooling
- name: Run build
run: |
set -xe
bash ./.ci/setup-builder
bash ./.ci/run-deploy
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.NATIVE_DEPLOY_KEY }}
known_hosts: ${{ secrets.NATIVE_DEPLOY_KNOWN_HOSTS }}
- name: Acquire latest compat file
env:
NATIVE_DEPLOY_URL: ${{ secrets.NATIVE_DEPLOY_URL }}
run: |
mkdir ./in
rsync -q --ignore-missing-args $NATIVE_DEPLOY_URL/natives_global_client_compat.lua ./in/natives_global_client_compat.lua
- name: Run build
run: |
set -xe
bash ./.ci/setup-builder
bash ./.ci/run-deploy
- name: Deploy
env:
NATIVE_DEPLOY_URL: ${{ secrets.NATIVE_DEPLOY_URL }}
run: |
rsync -r --delete-after --quiet ./out/ $NATIVE_DEPLOY_URL
rsync -rq --delete-after --exclude=*compat.lua* ./out/ $NATIVE_DEPLOY_URL
rsync -rqb --backup-dir=./ --suffix=.bak --include=*compat.lua --exclude=* ./out/ $NATIVE_DEPLOY_URL

0 comments on commit fdb8fcc

Please sign in to comment.