Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
first commit

updates

Update README and LaTeX build configuration with correct repository name

Update update.yml

update

updates

update

update template
  • Loading branch information
dariusptrs committed Jun 24, 2024
1 parent 96bb6bd commit ae962bd
Show file tree
Hide file tree
Showing 45 changed files with 508 additions and 96 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/inhaltlicher_fehler.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Inhaltlicher Fehler
description: Hilf uns Fehler zu Verbessern
title: ''
labels: [bug]
assignees: []

Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,29 @@ on:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12.2'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r scripts/requirements.txt
- name: Run pytest
run: pytest

build:
runs-on: ubuntu-latest
container: makeappdev/uselatex:latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetches all history for all branches and tags

fetch-depth: 0
- name: Configure Git safe directory with GITHUB_WORKSPACE
run: git config --global --add safe.directory $GITHUB_WORKSPACE

Expand Down
49 changes: 25 additions & 24 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
name: Update README and LaTeX Build File

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
update-files-and-rename-tex:
update-and-create-pr:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Extract repository name
run: echo "REPO_NAME=$(echo ${{ github.repository }} | sed 's|.*/||')" >> $GITHUB_ENV

- name: Update README
run: |
sed -i "1s/.*/# ${{ env.REPO_NAME }}/" README.md
sed -i "/Actions Status/c\[![Actions Status](https://github.com/${{ github.repository }}/workflows/CI/badge.svg)](https://github.com/${{ github.repository }})" README.md
- name: Update CMakeLists.txt with new LaTeX file name
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12.2'

- name: Run update script
run: python scripts/update_files.py
- name: Configure Git
run: |
sed -i "/project(/c\\project(${{ env.REPO_NAME }} NONE)" CMakeLists.txt
sed -i "0,/[^ ]*\.tex/s//${{ env.REPO_NAME }}.tex/" CMakeLists.txt
- name: Setup Git
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Commit changes to a new branch
run: |
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git config --local user.name "${{ github.actor }}"
- name: Commit and push if changed
git checkout -b changes/${{ github.run_id }}
git add .
git commit -m "Apply automated updates"
git push -u origin changes/${{ github.run_id }}
- name: Create Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add README.md CMakeLists.txt
git diff --staged --quiet || git commit -m "Update README and LaTeX build configuration with correct repository name"
git push
gh pr create --base main --head changes/${{ github.run_id }} --title "Specify project URLs and CMake project" --body "Please review the changes applied by the automated script."
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,4 @@ sympy-plots-for-*.tex/

# xindy
*.xdy
git.id
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.12)

project(CheatsheetTemplate NONE)
project(Computertechnik NONE)
include(UseLATEX)

add_custom_target(
Expand All @@ -12,12 +12,12 @@ add_custom_target(
set(IMAGE_DIRS
img
#Add subdirectories here
#img/logic
#img/rca
img/logic
img/rca
)

add_latex_document(
CheatsheetTemplate.tex
Computertechnik.tex
FORCE_PDF
IMAGE_DIRS ${IMAGE_DIRS}
DEPENDS writegitid
Expand Down
62 changes: 0 additions & 62 deletions CheatsheetTemplate.tex

This file was deleted.

Loading

0 comments on commit ae962bd

Please sign in to comment.