Skip to content

Publish Release

Publish Release #17

Workflow file for this run

name: Publish Release
on:
push:
tags:
- v*
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # need git history for spotless license header
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run Maven deploy
run: ./mvnw deploy -DperformRelease=true --settings .settings.xml -pl chaos-monkey-spring-boot
env:
SONATYPE_USERTOKEN: ${{ secrets.SONATYPE_USERTOKEN }}
SONATYPE_USERTOKENPASSWORD: ${{ secrets.SONATYPE_USERTOKENPASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Generate docs
run: ./mvnw generate-resources -pl chaos-monkey-docs
- name: Gather docs
run: |
mkdir ./docs/latest
cp -R ./chaos-monkey-docs/target/generated-docs/. ./docs/latest/
cp README.md ./docs/
sed -i 's/docs\/images/images/g' ./docs/README.md
- name: Publish gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
enable_jekyll: true
publish_dir: ./docs
commit_message: ${{ github.event.head_commit.message }}
create_github_release:
name: "Create Github Release"
needs: deploy
runs-on: ubuntu-latest
env:
TAG_NAME: ${{ github.ref }}
steps:
- name: Set TAG_NAME without ref
run: echo "TAG_NAME_WITHOUT_REF=${TAG_NAME//refs\/tags\/}" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
fetch-depth: 0 # need git history for spotless license header
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Generate documentation (docbook, html, zip)
run: ./mvnw asciidoctor:process-asciidoc@output-docbook generate-resources -pl chaos-monkey-docs
- name: Convert changelog from docbook to markdown
uses: docker://pandoc/core:3.1
with:
args: "-f docbook -t gfm -o changes.md chaos-monkey-docs/target/generated-docbook/changes.xml --wrap=none"
- name: Generate jar with dependencies
run: ./mvnw package -pl chaos-monkey-spring-boot
- name: Create Github Release
uses: softprops/action-gh-release@v1
with:
body_path: changes.md
files: |
./chaos-monkey-docs/target/chaos-monkey-docs-*.zip
./chaos-monkey-spring-boot/target/chaos-monkey-spring-boot-*-jar-with-dependencies.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}