Skip to content

Commit

Permalink
Merge pull request #135 from isaqb-org/132-improve-release-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
programming-wolf authored Feb 28, 2023
2 parents d4bf7b5 + 7502e32 commit a881c08
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 18 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/build_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,21 @@ jobs:
with:
distribution: 'temurin'
java-version: 17
- name: Execute Gradle Build
uses: eskatos/gradle-command-action@v2
with:
# Gradle command line arguments, see gradle --help
gradle-version: 7.5.1
arguments: buildDocs

# do the following two things only for a release!
# 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: |
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/build_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ jobs:
distribution: 'temurin'
java-version: 17
- name: Execute Gradle Build
uses: eskatos/gradle-command-action@v2
uses: gradle/gradle-build-action@v2
with:
# Gradle command line arguments, see gradle --help
gradle-version: 7.5.1
gradle-version: wrapper
arguments: buildDocs
13 changes: 10 additions & 3 deletions .github/workflows/build_releasecandidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,18 @@ jobs:
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: eskatos/gradle-command-action@v2
uses: gradle/gradle-build-action@v2
env:
CI: true
with:
# Gradle command line arguments, see gradle --help
gradle-version: 7.5.1
gradle-version: wrapper
arguments: buildDocs

# do the following two things only for a release!
Expand Down
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# New in 2020.6
# 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
- Update to latest Gradle (7.5.1)
1 change: 0 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ git clone https://github.com/isaqb-org/advanced-template.git --recursive
. Open the file `build.gradle` to adjust attributes specific to your curriculum:
[loweralpha]
.. `curriculumFileName`: the name of the asciidoc root file of your curriculum e.g. `curriculum-flex` (see above! The `.adoc` suffix is added automatically, omit it here!)
. Edit the file `document.version` and enter the version number this new version of the curriculum shall have e.g. "2020.1".
. Open README.adoc and replace the string `curriculum-template` with the name of your Github repository e.g. `curriculum-flex`
. Build the project with http://www.gradle.com[gradle] (you need a locally installed JDK) via `./gradlew`.
. Once the "BUILD SUCCESSFUL" is show, you can review the build result under `./build/index.html`
Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ ext {
today = new Date()
versionDate = new SimpleDateFormat("yyyyMMdd").format(today)

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

curriculumFileName = "curriculum-template"
addSuffixToCurriculum = { suffix ->
for (extension in ["html", "pdf"]) {
Expand Down
1 change: 0 additions & 1 deletion document.version

This file was deleted.

0 comments on commit a881c08

Please sign in to comment.