This commit is contained in:
Maximilian Keßler 2023-10-18 09:22:08 +02:00
parent 3483a24dca
commit 6aa92357e0
Signed by: max
GPG Key ID: BCC5A619923C0BA5
3 changed files with 37 additions and 47 deletions

View File

@ -15,4 +15,3 @@ cd build
mv LatexPackagesBuild LatexPackages
zip -r LatexPackages.zip LatexPackages/ -x '*.git*'
zip -r LatexPackagesDocumentation.zip documentation
tree -H '.' -I "index.html" -D --charset utf-8 -T "LatexPackages" > index.html

View File

@ -1,13 +1,13 @@
# ! /bin/sh
set -e
ssh git@gitlab.com
git clone git@gitlab.com:latexci/packages/LatexPackagesBuild.git build/LatexPackagesBuild
cd build/LatexPackagesBuild
REMOTE_BRANCH=$(git branch -a | sed -n '/remotes\/origin\/.*-build/p' | sed 's/remotes\/origin\///g' | sed 's/-build//g' | sed 's/[[:space:]]//g' | sed -n "/^${CI_COMMIT_REF_NAME}$/p")
echo ${REMOTE_BRANCH}
if [ "$REMOTE_BRANCH" = "" ];then
if [ "$REMOTE_BRANCH" = "" ]; then
echo "This is the first build on this branch, creating new branch in build repository to push to"
git checkout --orphan ${CI_COMMIT_REF_NAME}-build
ls -ra | sed '/^\.git$/d' | sed '/^\.\.$/d' | sed '/^\.$/d' | xargs -r git rm --cached

View File

@ -1,44 +1,35 @@
stages:
- get
- build
- pages
name: Build LaTeX packages
on: [push]
get-build-repo:
stage: get
before_script:
- source .ci/configure_git.sh
script:
- echo "Getting old Build repo..."
- .ci/get_build_repo_from_origin.sh
artifacts:
paths:
- build/
tags:
- latex
build-packages:
stage: build
before_script:
- source .ci/configure_git.sh
script:
- echo "Building packages incrementally..."
- sh .ci/ci_build.sh
variables:
GIT_SUBMODULE_STRATEGY: recursive
artifacts:
paths:
- build/
tags:
- latex
pages:
stage: pages
artifacts:
paths:
- public/
script:
- mv build/ public/
tags:
- latex
only:
- master
jobs:
build:
runs-on: latex-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup git credentials and committer
run: .ci/configure_git.sh
- name: Clone build repository
uses: actions/checkout@v4
with:
repository: latex-packages/latex-packages-build
fetch-depth: 0 # We need all history to correctly parse tag names
fetch-tags: true
path: build/LatexPackagesBuild
- name: Checkout correct branch in build repository
run: |
.ci/setup_build_repo_branch.sh
cd build/LatexPackagesBuild
git ls-remote --heads
- name: Build packages
run: |
.ci/ci_build.sh # Note that this includes pushing to the build mirror
deploy-pages:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- name: Deploy to pages
uses: actions/pages@v1
with:
directory: build/