diff --git a/.github/workflows/pull_request_secure.yml b/.github/workflows/pull_request_secure.yml index cf7849a3ac..720f8abd3f 100644 --- a/.github/workflows/pull_request_secure.yml +++ b/.github/workflows/pull_request_secure.yml @@ -6,13 +6,13 @@ name: Secured Workflow on: push: - branches: [main] + branches: [ main ] # There are two differences to "pull_request" here: # - The workflow will receive secrets, even in PRs from forks. # - The workflow will be executed automatically, without requiring a manual approval. # Therefore the workflow needs to be explicitly secured; see "known_user" and "approval_required" jobs below. pull_request_target: - branches: [main] # Benchmarks aren't branched, so they will only ever work against current main. + branches: [ main ] # Benchmarks aren't branched, so they will only ever work against current main. types: - opened - reopened @@ -266,13 +266,7 @@ jobs: name: Build Documentation env: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - GURL: "https://github.com/${{ github.event.pull_request.head.repo.owner.login || 'TimefoldAI' }}/timefold-solver" steps: - - name: Install yq - run: | - sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq - sudo chmod +x /usr/bin/yq - - name: Checkout frontend id: checkout-frontend uses: actions/checkout@v4 @@ -287,13 +281,43 @@ jobs: node-version-file: .nvmrc cache: npm + - name: Checkout timefold-solver + uses: actions/checkout@v4 + with: + repository: "${{ github.event.pull_request.head.repo.owner.login || 'TimefoldAI' }}/timefold-solver" + ref: ${{ github.event.pull_request.head.sha || 'main' }} # The GHA event will pull the main branch by default, and we must specify the PR reference version + path: "./timefold-solver" + fetch-depth: 0 + + - name: Install yq + run: | + sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq + sudo chmod +x /usr/bin/yq + + - name: Updating Antora configuration + working-directory: "./timefold-solver" + run: | + echo "=== Updating antora.yml" + cp docs/src/antora-template.yml docs/src/antora.yml + sed -i "s/\${project\.version}b0/SNAPSHOT/g" docs/src/antora.yml + sed -i "s/\${project\.version}/SNAPSHOT/g" docs/src/antora.yml + sed -i "s/\${maven\.compiler\.release}/$(find build/build-parent/ -name pom.xml -exec grep '' {} \;|tail -n 1|cut -d\> -f1 --complement|cut -d\< -f1)/g" docs/src/antora.yml + sed -i "s/\${maven\.min\.version}/$(find build/build-parent/ -name pom.xml -exec grep '' {} \;|tail -n 1|cut -d\> -f1 --complement|cut -d\< -f1)/g" docs/src/antora.yml + sed -i "s/\${version\.io\.quarkus}/$(find build/build-parent/ -name pom.xml -exec grep '' {} \;|tail -n 1|cut -d\> -f1 --complement|cut -d\< -f1)/g" docs/src/antora.yml + sed -i "s/\${version\.org\.springframework\.boot}/$(find build/build-parent/ -name pom.xml -exec grep '' {} \;|tail -n 1|cut -d\> -f1 --complement|cut -d\< -f1)N/g" docs/src/antora.yml + sed -i "s/\${version\.ch\.qos\.logback}/$(find build/build-parent/ -name pom.xml -exec grep '' {} \;|tail -n 1|cut -d\> -f1 --complement|cut -d\< -f1)/g" docs/src/antora.yml + sed -i "s/\${version\.exec\.plugin}/$(find build/build-parent/ -name pom.xml -exec grep '' {} \;|tail -n 1|cut -d\> -f1 --complement|cut -d\< -f1)/g" docs/src/antora.yml + sed -i "s/\${version\.rewrite\.plugin}/$(find . -name pom.xml -exec grep '' {} \;|tail -n 1|cut -d\> -f1 --complement|cut -d\< -f1)/g" docs/src/antora.yml + cat docs/src/antora.yml + - name: Build Documentation + working-directory: "./" env: GIT_CREDENTIALS: ${{ secrets.GIT_CREDENTIALS }} run: | yq -i e 'del(.content.sources)' apps/docs/antora-playbook.yml yq -i e 'del(.site.keys)' apps/docs/antora-playbook.yml - yq -i e '.content.sources += [{"url": env(GURL), "branches": env(BRANCH_NAME), "start_path": "docs/src"}]' apps/docs/antora-playbook.yml + yq -i e '.content.sources += [{"url": "../../timefold-solver", "start_path": "docs/src"}]' apps/docs/antora-playbook.yml npm ci npm run build -- --filter docs diff --git a/docs/src/antora.yml b/docs/src/antora.yml deleted file mode 100644 index 295e0e9daf..0000000000 --- a/docs/src/antora.yml +++ /dev/null @@ -1,19 +0,0 @@ -# This file is temporary, since for the time being, we need to build docs from the main branch. -# Remove when 1.16.0 is out, otherwise this file quickly becomes stale. -name: timefold-solver -title: Timefold Solver 1.15.0 -version: latest -asciidoc: - attributes: - timefold-solver-version: 1.15.0 - timefold-solver-python-version: 1.15.0b0 - java-version: 17 - maven-version: 3.9.2 - python-version: '3.10' - quarkus-version: 3.15.1 - spring-boot-version: 3.3.5 - logback-version: 1.5.12 - exec-maven-plugin-version: 3.3.1 - rewrite-maven-plugin-version: 5.43.4 -nav: - - modules/ROOT/nav.adoc \ No newline at end of file