Release #15
Workflow file for this run
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
name: Release | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
# Build distribution package and upload the GitHub releases | |
dist: | |
if: github.repository == 'dita-ot/dita-ot' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: Set tag name | |
run: | | |
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Build distribution package | |
run: | | |
./gradlew --no-daemon | |
./gradlew dist -Pcommit=${GITHUB_SHA} -Ptag=${TAG} --no-daemon | |
env: | |
TAG: ${{ env.tag }} | |
- name: Deploy distribution package to releases | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
build/distributions/*.zip | |
# Build DITA-OT Docker image and deploy to ghcr.io | |
docker: | |
if: github.repository == 'dita-ot/dita-ot' | |
needs: dist | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set tag name | |
run: | | |
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Login | |
run: | | |
echo $PAT | docker login ghcr.io --username ditaotbot --password-stdin | |
env: | |
PAT: ${{ secrets.PACKAGE_REGISTRY }} | |
- name: Build image | |
run: | | |
docker build --tag ghcr.io/dita-ot/dita-ot:${VERSION} --build-arg VERSION=${VERSION} . | |
env: | |
VERSION: ${{ env.tag }} | |
- name: Deploy image | |
run: | | |
docker push ghcr.io/dita-ot/dita-ot:${VERSION} | |
env: | |
VERSION: ${{ env.tag }} | |
# Publish release to Maven | |
maven: | |
if: github.repository == 'dita-ot/dita-ot' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: Deploy Maven release | |
run: | | |
echo "$GPG_ASC" > 24AC15F2.asc | |
gpg --dearmor 24AC15F2.asc | |
./gradlew --no-daemon | |
./gradlew --no-daemon publish \ | |
-PossrhUsername=$OSSRH_USERNAME \ | |
-PossrhPassword=$OSSRH_PASSWORD \ | |
-Psigning.password=$SIGNING_PASSWORD \ | |
-Psigning.keyId=24AC15F2 \ | |
-Psigning.secretKeyRingFile=24AC15F2.asc.gpg | |
env: | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
SIGNING_PASSWORD: ${{ secrets.GPG_PASSPHRASE }} | |
GPG_ASC: ${{ secrets.GPG_ASC }} | |
homebrew: | |
if: github.repository == 'dita-ot/dita-ot' | |
needs: dist | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set tag name | |
run: | | |
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Create pull-request | |
uses: mislav/bump-homebrew-formula-action@v2 | |
with: | |
formula-name: dita-ot | |
tag-name: ${{ env.tag }} | |
base-branch: master | |
download-url: https://github.com/dita-ot/dita-ot/releases/download/${{ env.tag }}/dita-ot-${{ env.tag }}.zip | |
commit-message: | | |
{{formulaName}} {{version}} | |
Created via GitHub Action | |
env: | |
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_COMMITTER_TOKEN }} | |
update-website: | |
if: github.repository == 'dita-ot/dita-ot' | |
needs: dist | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set tag name | |
run: | | |
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Repository Dispatch | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.REPOSITORY_DISPATCH }} | |
repository: dita-ot/docs | |
event-type: release | |
client-payload: '{"dita_ot_version": "${{ env.tag }}", "docs_tag": "${{ env.tag }}"}' |