Skip to content

Commit

Permalink
Merge branch 'main' of github.com:isaqb-org/curriculum-foundation
Browse files Browse the repository at this point in the history
  • Loading branch information
gernotstarke committed Jul 24, 2024
2 parents 9416e36 + 159d6b2 commit d9c081d
Show file tree
Hide file tree
Showing 14 changed files with 347 additions and 297 deletions.
69 changes: 2 additions & 67 deletions .github/workflows/build_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,71 +10,6 @@ on:
tags:
- "[2-9][0-9][0-9][0-9].[0-9]+-rev[0-9]+"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Verify Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

# If we're building a release, we need to set the variable RELEASE_VERSION
- name: Set Environment Variables for Release Version
if: startsWith(github.ref, 'refs/tags/')
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV

- name: Execute Gradle Build
uses: gradle/gradle-build-action@v2
env:
CI: true
with:
gradle-version: wrapper
arguments: buildDocs

# release and deploy only if we're building a release
- name: Prepare Deployment
if: startsWith(github.ref, 'refs/tags/')
run: |
rm -rf ./build/tmp
cp ./docs-ext/curriculum-*.pdf ./build 2>/dev/null || :
zip -r release.zip ./build
mkdir release_dir
cp ./build/curriculum-*.pdf ./release_dir 2>/dev/null || :
mv release.zip ./release_dir/release-${{ env.RELEASE_VERSION }}.zip
- name: Create New Release
if: startsWith(github.ref, 'refs/tags/')
id: create-release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag: ${{ env.RELEASE_VERSION }}
name: Release ${{ env.RELEASE_VERSION }}
draft: false
prerelease: false
bodyFile: "CHANGELOG.md"
artifacts: "license-copyright/LICENSE.adoc,release_dir/*.pdf,release_dir/*.zip"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy
if: startsWith(github.ref, 'refs/tags/')
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: Publish Release ${{ env.RELEASE_VERSION }}
call_workflow_build:
uses: isaqb-org/github-workflows/.github/workflows/build_main.yml@main
29 changes: 3 additions & 26 deletions .github/workflows/build_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,8 @@ name: CI – Pull Requests
# events but only for the main branch
on:
pull_request:

branches: [ main ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Verify Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Execute Gradle Build
uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper
arguments: buildDocs
jobs:
call_workflow_build_pr:
uses: isaqb-org/github-workflows/.github/workflows/build_pr.yml@main
78 changes: 2 additions & 76 deletions .github/workflows/build_releasecandidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,80 +9,6 @@ on:
tags:
- "[2-9][0-9][0-9][0-9].[0-9]+-RC[0-9]+"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Update index.adoc
run: |
rm docs/index.adoc
mv docs/index_rc.adoc docs/index.adoc
- name: Verify Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

# If we're building a release, we need to set the variable RELEASE_VERSION
- name: Set Environment Variables for Release Version
if: startsWith(github.ref, 'refs/tags/')
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV

- name: Execute Gradle Build
uses: gradle/gradle-build-action@v2
env:
CI: true
with:
gradle-version: wrapper
arguments: buildDocs

# do the following two things only for a release!
- name: Set Environment Variables for Release Version
if: startsWith(github.ref, 'refs/tags/')
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- name: Prepare Deployment
if: startsWith(github.ref, 'refs/tags/')
run: |
rm -rf ./build/tmp
cp ./docs-ext/curriculum-*.pdf ./build 2>/dev/null || :
zip -r release.zip ./build
mkdir release_dir
cp ./build/curriculum-*.pdf ./release_dir 2>/dev/null || :
mv release.zip ./release_dir/release-${{ env.RELEASE_VERSION }}.zip
- name: Create New Release Candidate
if: startsWith(github.ref, 'refs/tags/')
id: create-release-candidate
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag: ${{ env.RELEASE_VERSION }}
name: Release Candidate ${{ env.RELEASE_VERSION }}
draft: false
prerelease: true
bodyFile: "CHANGELOG.md"
artifacts: "license-copyright/LICENSE.adoc,release_dir/*.pdf,release_dir/*.zip"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy Release Candidate to GitHub Pages
if: startsWith(github.ref, 'refs/tags/')
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
destination_dir: release-candidate
keep_files: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: Publish Release Candidate ${{ env.RELEASE_VERSION }}
call_workflow_build_pr:
uses: isaqb-org/github-workflows/.github/workflows/build_releasecandidate.yml@main
10 changes: 10 additions & 0 deletions .github/workflows/update_pr_with_comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Comment on Pull Request

on:
workflow_run:
types: [completed]
workflows: [CI – Pull Requests]

jobs:
call_workflow_build:
uses: isaqb-org/github-workflows/.github/workflows/update_pr_with_comment.yml@main
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Table of Contents
- [Changes in 2025.1](#changes-in-20251)
- [Very Short Summary](#very-short-summary)
- [Summary](#summary)
- [Detailed Change History](#detailed-change-history)

# Changes in 2025.1

The baseline for the following comparison is the latest release of 2023.1

Abbreviations used below:

* LG: Learning goal
* LGI: Learning goal item (_bullet item_ within LG)
* RC: Release candidate


The list of fixed/resolved issues can be found in the [Kanban board](https://github.com/isaqb-org/curriculum-foundation/projects/7) on GitHub.
For 2025.1, we have resolved more than XXX issues, comments and problems in both the English (EN) and German (DE) version.

## Very Short Summary

> some text
## Summary

* some more text

## Detailed Change History
In case you are curious, have a look at the commit history.
Work relevant for 2025.1 has begun October 2023, and resulted in more than 120 commits to the repository.

>Count commits across all branches:
>`git rev-list --all --count --since="23 October 2023"`
![Commits since last version](https://img.shields.io/github/commits-since/isaqb-org/curriculum-foundation/2023.1-rev3.svg)
124 changes: 30 additions & 94 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,110 +1,46 @@
import org.asciidoctor.gradle.jvm.AsciidoctorTask
import java.text.SimpleDateFormat

plugins {
id "org.asciidoctor.jvm.base" version "3.3.2"
id "org.asciidoctor.jvm.convert" version "3.3.2"
id "org.asciidoctor.jvm.pdf" version "3.3.2"
id "java"
id "application"
}

def group = "org.isaqb"
def releaseVersion = System.getenv("RELEASE_VERSION")
def localVersion = "LocalBuild"
project.version = releaseVersion == null ? localVersion : releaseVersion
def curriculumFileName = "curriculum-foundation"
def versionDate = new SimpleDateFormat("yyyyMMdd").format(new Date())
def languages = ["DE", "EN"]
def validity = project.file("./document.validity").text.trim()

repositories {
mavenCentral()
}

asciidoctorj {
version = '2.5.3'
dependencies {
implementation("org.asciidoctor:asciidoctorj:2.5.10")
implementation("org.asciidoctor:asciidoctorj-pdf:2.3.9")
}

ext {
today = new Date()
versionDate = new SimpleDateFormat("yyyyMMdd").format(today)

releaseVersion = System.getenv("RELEASE_VERSION")
localVersion = "LocalBuild"
project.version = releaseVersion == null ? localVersion : releaseVersion;

validity = new Date(project.file("./document.validity").text.trim())
validityEnglish = "valid from " + new SimpleDateFormat("MMMM d, yyyy", Locale.US).format(validity)
validityGerman = "Gültig ab " + new SimpleDateFormat("d. MMMM yyy", Locale.GERMANY).format(validity)

curriculumFileName = "curriculum-foundation"
addSuffixToCurriculum = { suffix ->
for (extension in ["html", "pdf"]) {
File source = new File("${buildDir}/${curriculumFileName}.${extension}")
File target = new File("${buildDir}/${curriculumFileName}${suffix}.${extension}")

source.renameTo(target)
}
}
application {
mainClass.set("org.isaqb.asciidoc.Main")
applicationDefaultJvmArgs = [
"""-DprojectVersion=${project.version}""",
"""-DcurriculumFileName=${curriculumFileName}""",
"""-DversionDate=${versionDate}""",
"""-Dlanguages=${languages.join(',')}""",
"""-Dvalidity=${validity}""",
"""--add-opens""", """java.base/sun.nio.ch=ALL-UNNAMED""",
"""--add-opens""", """java.base/java.io=ALL-UNNAMED"""]
}

class RenderCurriculumTask extends AsciidoctorTask {
@Inject
RenderCurriculumTask(WorkerExecutor we, String curriculumFileName, String versionDate, String validity, String language) {
super(we)

forkOptions {
jvmArgs "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED"
}


sourceDir = new File("./docs/")
baseDir = new File("./docs/")
sources {
include "index.adoc"
include "${curriculumFileName}.adoc"
}
outputDir = new File("./build/")
outputOptions {
separateOutputDirs = false
backends 'pdf', 'html5'
}

def fileVersion = project.version.trim() + "-" + language

attributes = [
'icons' : 'font',
'version-label' : '',
'revnumber' : fileVersion,
'revdate' : versionDate,
'document-version' : fileVersion + "-" + versionDate + " (" + validity + ")",
'currentDate' : versionDate,
'language' : language,
'curriculumFileName': curriculumFileName,
'debug_adoc' : false,
'pdf-stylesdir' : '../pdf-theme/themes',
'pdf-fontsdir' : '../pdf-theme/fonts',
'pdf-style' : 'isaqb',
'stylesheet' : '../html-theme/adoc-github.css',
'stylesheet-dir' : '../html-theme',
'glossary_url' : 'https://public.isaqb.org/glossary/glossary-' + language.toLowerCase() + '.html#term-'
]
}
}

task buildDocs {
group 'Documentation'
description 'Grouping task for generating all languages in several formats'
dependsOn "includeLearningGoals", "renderDE", "renderEN"
}

task renderDE(type: RenderCurriculumTask,
constructorArgs: [curriculumFileName, versionDate, validityGerman, "DE"]) {
group 'Documentation'
description 'Builds the German curriculum as PDF and HTML file.'
doLast {
addSuffixToCurriculum("-de")
}
}
apply from: 'scripts/includeLearningGoals.gradle'

task renderEN(type: RenderCurriculumTask,
constructorArgs: [curriculumFileName, versionDate, validityEnglish, "EN"]) {
group 'Documentation'
description 'Builds the English curriculum as PDF and HTML file.'
doLast {
addSuffixToCurriculum("-en")
}
tasks.register('buildDocs') {
description = 'Grouping task for generating all languages in several formats'
group = 'documentation'
dependsOn "includeLearningGoals", "run"
}

apply from: 'scripts/includeLearningGoals.gradle'

defaultTasks "buildDocs"
Loading

0 comments on commit d9c081d

Please sign in to comment.