[build] v4.2.0 #24
Workflow file for this run
This file contains hidden or 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
name: Release | |
on: | |
push: | |
tags: | |
- '*' | |
permissions: | |
contents: write | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ ubuntu-24.04, windows-latest, macos-latest ] | |
java: [ '11', '17', '21' ] | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.os }} - Java ${{ matrix.java }} release | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: Setup Environment (Ubuntu) | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get -y update | |
sudo apt-get -y upgrade | |
sudo apt-get -y install language-pack-ja-base language-pack-ja | |
sudo update-locale LANG=ja_JP.UTF8 | |
sudo apt-get -y install fonts-noto* language-selector-common | |
export LANG=ja_JP.UTF-8 | |
fc-cache -f | |
fc-match Dialog | grep "Noto Sans CJK JP" | |
sudo apt-get -y install graphviz | |
# for GitHub Actions test | |
sudo apt-get -y install poppler-utils | |
- name: Setup Environment (macOS) | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
brew install graphviz | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
- name: Build with Gradle (Ubuntu) | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
# Check font settings | |
export LANG=ja_JP.UTF-8 | |
fc-match Dialog | grep "Noto Sans CJK JP" | |
## Workaround to suppress warnings from JRuby in JDK 17 or later (https://github.com/jruby/jruby/issues/6721) | |
## export JDK_JAVA_OPTIONS="--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" | |
./gradlew docs | |
- name: Build with Gradle (macOS) | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
## Workaround to suppress warnings from JRuby in JDK 17 or later (https://github.com/jruby/jruby/issues/6721) | |
## export JDK_JAVA_OPTIONS="--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" | |
./gradlew docs | |
- name: Build with Gradle (Windows) | |
if: startsWith(matrix.os, 'windows') | |
shell: pwsh | |
run: | | |
## Workaround to suppress warnings from JRuby in JDK 17 or later (https://github.com/jruby/jruby/issues/6721) | |
## $env:JDK_JAVA_OPTIONS = "--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" | |
.\gradlew docs | |
- name: Set archive attribute | |
id: get-attr | |
shell: bash | |
run: | | |
# document filename | |
echo "doc-name=asciidoctor-gradle-book" >> $GITHUB_OUTPUT | |
# document version from git tag | |
echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
- name: Archive | |
shell: bash | |
run: | | |
DOCNAME=${{ steps.get-attr.outputs.doc-name }} | |
VERSION=${{ steps.get-attr.outputs.version }} | |
mv docs/index.pdf docs/${DOCNAME}-${VERSION}.pdf | |
mv docs/index.html docs/${DOCNAME}-${VERSION}.html | |
tar zcvf ${DOCNAME}-${VERSION}-by-${{ matrix.os }}-java-${{ matrix.java }}.tar.gz docs | |
- uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "${{ steps.get-attr.outputs.doc-name }}-${{ steps.get-attr.outputs.version }}-by-${{ matrix.os }}-java-${{ matrix.java }}.tar.gz" | |
allowUpdates: true | |
token: ${{ secrets.GITHUB_TOKEN }} |