generated from isaqb-org/advanced-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4a596b9
Showing
66 changed files
with
2,233 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# exclude .gitignore, CI config and similar from the generated tarball | ||
.git* export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: CI - Releases and Main | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
# events but only for the main branch | ||
on: | ||
push: | ||
branches: [ main ] | ||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: CI – Pull Requests | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
# 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 | ||
- name: Upload Build Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: curriculum files (PDF and HTML) | ||
path: | | ||
build/*.pdf | ||
build/*.html | ||
retention-days: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: CI – Release Candidate | ||
|
||
# Controls when the action will run. Triggers the workflow on push events if the pushed | ||
# tag is a release candidate | ||
on: | ||
push: | ||
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: 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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Comment on Pull Request | ||
|
||
on: | ||
workflow_run: | ||
types: [completed] | ||
workflows: [CI – Pull Requests] | ||
|
||
jobs: | ||
comment: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} && ${{github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get Artifact and Pull request info | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
WORKFLOW_RUN_EVENT_OBJ: ${{ toJSON(github.event.workflow_run) }} | ||
OWNER: ${{ github.repository_owner }} | ||
REPO: ${{ github.event.repository.name }} | ||
run: | | ||
PREVIOUS_JOB_ID=$(jq -r '.id' <<< "$WORKFLOW_RUN_EVENT_OBJ") | ||
echo "Previous Job ID: $PREVIOUS_JOB_ID" | ||
echo "PREVIOUS_JOB_ID=$PREVIOUS_JOB_ID" >> "$GITHUB_ENV" | ||
SUITE_ID=$(jq -r '.check_suite_id' <<< "$WORKFLOW_RUN_EVENT_OBJ") | ||
echo "Previous Suite ID: $SUITE_ID" | ||
echo "SUITE_ID=$SUITE_ID" >> "$GITHUB_ENV" | ||
ARTIFACT_ID=$(gh api "/repos/$OWNER/$REPO/actions/artifacts" \ | ||
--jq ".artifacts.[] | | ||
select(.workflow_run.id==${PREVIOUS_JOB_ID}) | | ||
select(.expired==false) | | ||
.id") | ||
echo "Artifact ID: $ARTIFACT_ID" | ||
echo "ARTIFACT_ID=$ARTIFACT_ID" >> "$GITHUB_ENV" | ||
PR_NUMBER=$(jq -r '.pull_requests[0].number' \ | ||
<<< "$WORKFLOW_RUN_EVENT_OBJ") | ||
echo "Pull request Number: $PR_NUMBER" | ||
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_ENV" | ||
HEAD_SHA=$(jq -r '.pull_requests[0].head.sha' \ | ||
<<< "$WORKFLOW_RUN_EVENT_OBJ") | ||
echo "Head SHA: $HEAD_SHA" | ||
echo "HEAD_SHA=$HEAD_SHA" >> "$GITHUB_ENV" | ||
- name: Find Comment | ||
uses: peter-evans/find-comment@v2 | ||
id: find-comment | ||
with: | ||
issue-number: ${{ env.PR_NUMBER }} | ||
comment-author: 'github-actions[bot]' | ||
- name: Update Comment | ||
env: | ||
JOB_PATH: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ env.PREVIOUS_JOB_ID }}" | ||
ARTIFACT_URL: "${{ github.server_url }}/${{ github.repository }}/suites/${{ env.SUITE_ID }}/artifacts/${{ env.ARTIFACT_ID }}" | ||
HEAD_SHA: "${{ env.HEAD_SHA }}" | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
issue-number: ${{ env.PR_NUMBER }} | ||
comment-id: ${{ steps.find-comment.outputs.comment-id }} | ||
edit-mode: replace | ||
body: |- | ||
Build Successful! You can find a link to the downloadable artifacts below. | ||
| Name | Link | | ||
| -------- | ----------------------- | | ||
| Commit | ${{ env.HEAD_SHA }} | | ||
| Logs | ${{ env.JOB_PATH }} | | ||
| Download | ${{ env.ARTIFACT_URL }} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.DS_Store | ||
|
||
.gradle | ||
build | ||
.idea | ||
advanced-template.iml | ||
.settings/org.eclipse.buildship.core.prefs | ||
.project | ||
learning-objectives.adoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[submodule "pdf-theme"] | ||
path = pdf-theme | ||
url = https://github.com/isaqb-org/pdf-theme | ||
[submodule "html-theme"] | ||
path = html-theme | ||
url = https://github.com/isaqb-org/html-theme | ||
[submodule "license-copyright"] | ||
path = license-copyright | ||
url = https://github.com/isaqb-org/license-copyright |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "gradle", | ||
"type": "shell", | ||
"command": "gradle", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Release Notes | ||
## New in 2020.7 | ||
- Remove lots of old/unused stuff regarding remarks | ||
- Use Gradle Wrapper in GitHub Actions | ||
- Take document version from git tag | ||
|
||
## New in 2020.6 | ||
|
||
- CHANGELOG can be created from file | ||
- Use new and simplified release action | ||
- Update to latest Aciidoctor versions | ||
- Update to latest Gradle (7.5.1) |
Oops, something went wrong.