Release #16
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: | |
workflow_dispatch: | |
inputs: | |
release_name: | |
description: Release name | |
required: true | |
env: | |
INSTANCE: 'Writerside/zpc' | |
ARTIFACT: 'webHelpZPC2-all.zip' | |
DOCKER_VERSION: '233.14938' | |
jobs: | |
collect-commits: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Setup Doxygen | |
run: | | |
wget https://github.com/doxygen/doxygen/releases/download/Release_1_10_0/doxygen-1.10.0.linux.bin.tar.gz | |
tar xzvf doxygen-1.10.0.linux.bin.tar.gz | |
cd doxygen-1.10.0 | |
sudo make install | |
- name: Get last release information | |
id: get_last_release | |
run: | | |
LAST_RELEASE=$(git describe --tags --abbrev=0) | |
echo "::set-output name=tag::$LAST_RELEASE" | |
- name: Get commit messages since last release | |
id: get_commit_messages | |
run: | | |
git fetch --tags | |
git log --pretty=format:"%s" ${{ steps.get_last_release.outputs.tag }}..HEAD > commit_messages.txt | |
- name: Create release description | |
id: create_release_description | |
run: | | |
while IFS= read -r line; do | |
case $line in | |
*chore:*) echo "**$line**" >> release_description.txt;; | |
*fix:*) echo "**$line**" >> release_description.txt;; | |
*docs:*) echo "**$line**" >> release_description.txt;; | |
*feat:*) echo "**$line**" >> release_description.txt;; | |
*) echo "$line" >> release_description.txt;; | |
esac | |
done < commit_messages.txt | |
- name: Generate PHPDocs | |
run: | | |
git pull --rebase | |
doxygen | |
tree | |
git config --global user.email "[email protected]" | |
git config --global user.name "AdministrationBot" | |
- name: Publish PHPDocs | |
run: | | |
git add . | |
git diff --quiet || git commit -m "docs: Update PHPDocs" | |
git push | |
- name: Build classic docs | |
uses: JetBrains/writerside-github-action@v4 | |
with: | |
instance: ${{ env.INSTANCE }} | |
artifact: ${{ env.ARTIFACT }} | |
docker-version: ${{ env.DOCKER_VERSION }} | |
- name: Unzip generated files | |
run: | | |
mkdir -p docs/classic | |
unzip -o artifacts/${{ env.ARTIFACT }} -d docs/classic | |
- name: Publish classic docs | |
run: | | |
git add . | |
git diff --quiet || git commit -m "docs: Update classic docs" | |
git push | |
- name: Get release description | |
id: read_release_description | |
run: | | |
cat release_description.txt | |
echo "::set-output name=description::$(cat release_description.txt)" | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} | |
with: | |
tag_name: ${{ github.event.inputs.release_name }} | |
release_name: ${{ github.event.inputs.release_name }} |