Skip to content

Commit

Permalink
Issue #12082: Github action Publish release notes outside
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and romani committed Aug 27, 2022
1 parent ca99792 commit b519b15
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions .ci/jsoref-spellchecker/whitelist.words
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ gh
ghprb
gitattributes
github
githubpage
githubusercontent
Gjs
globbing
Expand Down
24 changes: 24 additions & 0 deletions .ci/publish-releasenotes-githubpage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

set -e

if [[ -z $1 ]]; then
echo "version is not set"
echo "Usage: publish-releasenotes-githubpage.sh <version>"
exit 1
fi

TARGET_VERSION=$1
echo TARGET_VERSION="$TARGET_VERSION"

CURRENT_VERSION=$(xmlstarlet sel -N pom=http://maven.apache.org/POM/4.0.0 \
-t -m pom:project -v pom:version pom.xml | sed "s/-SNAPSHOT//")
echo CURRENT_VERSION="$CURRENT_VERSION"

if [ "$TARGET_VERSION" != "$CURRENT_VERSION" ]; then
echo "[ERROR] Target Version and Current Version doesn't match."
exit 1;
fi

# Update GitHub Release Page
./.ci/update-github-page.sh "$TARGET_VERSION"
24 changes: 24 additions & 0 deletions .github/workflows/publish_releasenotes_outside.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#############################################################################
# GitHub Action to Publish Release Notes GitHub Page.
#
#############################################################################
name: "Publish Release notes GitHub Page"
on:
workflow_dispatch:
inputs:
version:
description: 'Target Version without (-SNAPSHOT)'
required: true
jobs:
publish:
name: Publish releasenotes GitHub Page ${{ github.event.inputs.version }}
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v2
- name: Download xmlstarlet
run: |
sudo apt-get install xmlstarlet
- name: Run Shell Script
run: |
./.ci/publish-releasenotes-githubpage.sh ${{ github.event.inputs.version }}

0 comments on commit b519b15

Please sign in to comment.