Skip to content

#36: Add configuration to asciidoctor-maven-plugin #75

#36: Add configuration to asciidoctor-maven-plugin

#36: Add configuration to asciidoctor-maven-plugin #75

name: CI/CD
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: devonfw-actions/java-maven-setup@v5
with:
maven-cache-key: dep-${{ hashFiles('**/pom.xml') }}
- name: Build & Test
run: mvn install
release:
needs: [build]
runs-on: ubuntu-latest
if: ${{ startsWith(github.repository, 'devonfw/') && github.ref == 'refs/heads/master' }}
continue-on-error: true
environment:
name: maven-central
outputs:
release_tag: ${{ steps.get_tag.outputs.tag }}
steps:
- uses: devonfw-actions/java-maven-setup@v5
with:
maven-cache-key: dep-${{ hashFiles('**/pom.xml') }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
BUILD_USER: ${{ secrets.BUILD_USER }}
BUILD_USER_PASSWD: ${{ secrets.BUILD_USER_PASSWD }}
BUILD_USER_EMAIL: ${{ secrets.BUILD_USER_EMAIL }}
- name: Release
id: release
shell: bash
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
BUILD_USER: ${{ secrets.BUILD_USER }}
BUILD_USER_PASSWD: ${{ secrets.BUILD_USER_PASSWD }}
BUILD_USER_EMAIL: ${{ secrets.BUILD_USER_EMAIL }}
run: ./release.sh silent repo-mvn-settings
- name: 'Get release tag'
id: get_tag
uses: "WyriHaximus/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GHA_TOKEN }}"
github-release:
needs: release
runs-on: ubuntu-latest
if: ${{ startsWith(github.repository, 'devonfw/') && github.ref == 'refs/heads/master' && startsWith(needs.release.outputs.release_tag, 'release') }}
steps:
- uses: devonfw-actions/create-github-release@v2
with:
release_version: ${{ needs.release.outputs.release_tag }}
GHA_TOKEN: ${{ secrets.GHA_TOKEN }}
apply-to-website:
needs: release
runs-on: ubuntu-latest
environment:
name: devonfw.com
if: ${{ startsWith(github.repository, 'devonfw/') && github.ref == 'refs/heads/master' && startsWith(needs.release.outputs.release_tag, 'release') }}
steps:
- name: Clone Repository
uses: devonfw-actions/java-maven-setup@v7
with:
repository: 'devonfw/devonfw.github.io'
GIT_TOKEN: ${{ secrets.GHA_TOKEN }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
BUILD_USER: ${{ secrets.BUILD_USER }}
BUILD_USER_PASSWD: ${{ secrets.BUILD_USER_PASSWD }}
BUILD_USER_EMAIL: ${{ secrets.BUILD_USER_EMAIL }}
- name: Setup Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.34'
- name: Apply new version to devonfw.com
run: |
set -e
find . -type f -name 'pom.xml' | xargs perl -0777 -pi -e 's|(<groupId>com.devonfw.tools</groupId>\s*<artifactId>devonfw-docgen[^<]*</artifactId>\s*<version>)[^<]+(</version>)|${1}${{ needs.release.outputs.release_tag }}$2|g'
git add -u
git commit -m"Update docgen to latest version"
git push
- name: Dispatch Website Repository
uses: guilouro/[email protected]
with:
repo_token: ${{ secrets.GHA_TOKEN }}
event_type: dispatch-build-website
repositories: |
devonfw/devonfw.github.io
apply-to-guide:
needs: release
runs-on: ubuntu-latest
environment:
name: devonfw-guide
if: ${{ startsWith(github.repository, 'devonfw/') && github.ref == 'refs/heads/master' && startsWith(needs.release.outputs.release_tag, 'release') }}
steps:
- name: Clone Repository
uses: devonfw-actions/java-maven-setup@v7
with:
repository: 'devonfw/devonfw-guide'
GIT_TOKEN: ${{ secrets.GHA_TOKEN }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
BUILD_USER: ${{ secrets.BUILD_USER }}
BUILD_USER_PASSWD: ${{ secrets.BUILD_USER_PASSWD }}
BUILD_USER_EMAIL: ${{ secrets.BUILD_USER_EMAIL }}
- name: Setup Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.34'
- name: Apply new version to devonfw.com
run: |
set -e
find . -type f -name 'pom.xml' | xargs perl -0777 -pi -e 's|(<groupId>com.devonfw.tools</groupId>\s*<artifactId>devonfw-docgen[^<]*</artifactId>\s*<version>)[^<]+(</version>)|${1}${{ needs.release.outputs.release_tag }}$2|g'
git add -u
git commit -m"Update docgen to latest version"
git push
- name: Dispatch Website Repository
uses: guilouro/[email protected]
with:
repo_token: ${{ secrets.GHA_TOKEN }}
event_type: dispatch-build-website
repositories: |
devonfw/devonfw-guide