2025-11-17 16:20:24 +01:00
|
|
|
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
|
|
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
|
|
|
|
#
|
|
|
|
|
# It could, in theory, be possible to grep the current version number from the pom.xml file,
|
|
|
|
|
# and, again, in theory, get the last release name from the git tag list.
|
|
|
|
|
# But, sofar, this has been a road with major obstacles. And in the end you've just got to ask yourself:
|
|
|
|
|
# "Is the juice worth the squeeze.". (Movie: "The girl next door")
|
|
|
|
|
|
|
|
|
|
name: Generate NEWS file.
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
build:
|
|
|
|
|
|
|
|
|
|
runs-on: docker
|
|
|
|
|
container:
|
|
|
|
|
image: ubuntu:24.04
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
# Define job-id
|
|
|
|
|
- name: Debug info
|
|
|
|
|
run: |
|
|
|
|
|
cat <<'EOF'
|
|
|
|
|
${{ toJSON(forgejo) }}
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
- name: My current run-id
|
|
|
|
|
run: echo "${{ forgejo.run_id }}"
|
|
|
|
|
|
|
|
|
|
- name: install needed software
|
|
|
|
|
run: |
|
|
|
|
|
apt-get update
|
|
|
|
|
apt-get install -y nodejs git sed
|
|
|
|
|
|
|
|
|
|
- name: Checkout code
|
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
with:
|
|
|
|
|
fetch-tags: true # Also get the tags!!!
|
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
|
|
# This is only possible AFTER the checkout step.
|
|
|
|
|
- name: actions prep test to prove it works.
|
|
|
|
|
id: artifact-upload-prep
|
|
|
|
|
run: echo "artifact-id=$(git rev-parse --short=10 HEAD)" >> "$GITHUB_OUTPUT"
|
|
|
|
|
|
|
|
|
|
- name: Start writing NEWS.rst.head file
|
|
|
|
|
shell: bash
|
|
|
|
|
run: |
|
|
|
|
|
FILE="NEWS.rst.head"
|
|
|
|
|
echo "Writing to file: $FILE"
|
|
|
|
|
#Version 1.4.0 (29 Apr 2013)
|
|
|
|
|
#---------------------------
|
2025-11-18 15:38:21 +01:00
|
|
|
headstr="Version ${{ vars.short_new_release }} ($(LANG=en;date '+%d %b %Y'))"
|
2025-11-17 16:20:24 +01:00
|
|
|
headstrlen=${#headstr}
|
|
|
|
|
# echo "headstrlen: $headstrlen"
|
|
|
|
|
headline="$(printf -- '-%.0s' $(seq 1 "$headstrlen"))"
|
|
|
|
|
# echo "headline: $headline"
|
|
|
|
|
echo "$headstr" | tee -a "${FILE}"
|
|
|
|
|
echo -e "$headline\n\n" | tee -a "${FILE}"
|
|
|
|
|
|
|
|
|
|
- name: Start writing summary NEWS.rst.summary
|
|
|
|
|
shell: bash
|
|
|
|
|
run: |
|
|
|
|
|
filepart=summary
|
|
|
|
|
FILE="NEWS.rst.summary"
|
2025-11-18 15:38:21 +01:00
|
|
|
#verstr="Version ${{ vars.short_new_release }} ($(LANG=en;date +'%d %b %Y'))"
|
2025-11-17 16:20:24 +01:00
|
|
|
#echo "$verstr"
|
|
|
|
|
#verstrlen=${#verstr} | tee -a "${FILE}"
|
|
|
|
|
#echo "$verstrlen"
|
|
|
|
|
#linestr="$(printf -- '-%.0s' $(seq 1 $verstrlen))"
|
|
|
|
|
#echo "$linestr" | tee -a "${FILE}"
|
|
|
|
|
echo "Summary" | tee -a "${FILE}"
|
|
|
|
|
echo -e "~~~~~~~\n" | tee -a "${FILE}"
|
2025-11-18 15:38:21 +01:00
|
|
|
echo "Description of the new version ${{ vars.short_new_release }}, explaining the main features and bugs " | tee -a "${FILE}"
|
2025-11-17 16:20:24 +01:00
|
|
|
echo "included. It's usually similar to the piece of news that will be published " | tee -a "${FILE}"
|
|
|
|
|
echo "on the website. " | tee -a "${FILE}"
|
|
|
|
|
echo "" | tee -a "${FILE}"
|
|
|
|
|
|
|
|
|
|
- name: Start writing NEWS.rst.notes for NEWS.
|
|
|
|
|
shell: bash
|
|
|
|
|
run: |
|
|
|
|
|
# Hm, in this stage we have not enough information for this part.
|
|
|
|
|
filepart=notes
|
|
|
|
|
FILE="NEWS.rst.notes"
|
|
|
|
|
echo "Writing to file: $FILE"
|
|
|
|
|
# yes, I know about HERE files. I just don't like them!
|
|
|
|
|
echo "Notes" | tee -a "${FILE}"
|
|
|
|
|
echo -e "~~~~~\n\n" | tee -a "${FILE}"
|
2025-11-18 15:38:21 +01:00
|
|
|
echo "If you are upgrading from ${{ vars.short_last_release }} without using a " | tee -a "${FILE}"
|
2025-11-17 16:20:24 +01:00
|
|
|
echo "package, you will need to manually execute on your database the SQL commands" | tee -a "${FILE}"
|
2025-11-18 15:38:21 +01:00
|
|
|
echo "from file: 'scripts/database/upgrade_${{ vars.short_new_release }}.sql'." | tee -a "${FILE}"
|
2025-11-17 16:20:24 +01:00
|
|
|
echo "" | tee -a "${FILE}"
|
|
|
|
|
echo "If you are upgrading from earlier version without using the Debian package," | tee -a "${FILE}"
|
|
|
|
|
echo "you will need to manually execute on your database the SQL commands from all files." | tee -a "${FILE}"
|
|
|
|
|
echo "" | tee -a "${FILE}"
|
|
|
|
|
|
|
|
|
|
- name: Start writing NEWS.rst.contributors for NEWS.
|
|
|
|
|
shell: bash
|
|
|
|
|
run: |
|
|
|
|
|
filepart=contributers
|
|
|
|
|
FILE="NEWS.rst.contributers"
|
|
|
|
|
echo "Contributors" | tee -a "${FILE}"
|
|
|
|
|
echo -e "~~~~~~~~~~~~\n" | tee -a "${FILE}"
|
|
|
|
|
echo -e "A big thanks to all the contributors to version ${{ inputs.short-new-release }} :\n" | tee -a "${FILE}"
|
2025-11-18 15:38:21 +01:00
|
|
|
#git shortlog -ns "${{ vars.full_last_release }}.." | cut -f2- | sed -e 's/^/* /' | sort -u | tee -a "${FILE}"
|
|
|
|
|
git shortlog -ns "${{ vars.full_last_release }}.." | cut -f2- | sed -e 's/^/* /' | sort -u | tee -a "${FILE}"
|
2025-11-17 16:20:24 +01:00
|
|
|
echo "" | tee -a "${FILE}"
|
|
|
|
|
|
|
|
|
|
- name: Start writing NEWS.rst.translators for NEWS.
|
|
|
|
|
shell: bash
|
|
|
|
|
run: |
|
|
|
|
|
# If there're changes in the translations we add the name and language of
|
|
|
|
|
# each of them in this section.
|
|
|
|
|
filepart=translators
|
|
|
|
|
FILE="NEWS.rst.translators"
|
|
|
|
|
# We do not insert new Translators block as we already copy the old block including the header.
|
|
|
|
|
# echo "Translators" | tee -a "${FILE}"
|
|
|
|
|
# echo -e "~~~~~~~~~~~\n\n" | tee -a "${FILE}"
|
|
|
|
|
echo "Inserting translator block from last release." | tee -a $LOG
|
|
|
|
|
cat NEWS.rst | sed -n -e '/^Translators/,/^Changes/p' | sed -e '/^Changes/,$d' | tee -a "${FILE}"
|
|
|
|
|
|
|
|
|
|
- name: Start writing NEWS.rst.changes
|
|
|
|
|
shell: bash
|
|
|
|
|
run: |
|
|
|
|
|
# Comprehensive list of changes done in the repository since previous
|
|
|
|
|
# version.
|
|
|
|
|
filepart=changes
|
|
|
|
|
FILE="NEWS.rst.changes"
|
|
|
|
|
echo "Writing to file: $FILE"
|
|
|
|
|
echo "Changes" | tee -a "${FILE}"
|
|
|
|
|
echo -e "~~~~~~~\n" | tee -a "${FILE}"
|
2025-11-18 15:38:21 +01:00
|
|
|
git log --pretty="* %s" "${{ vars.full_last_release }}.." | tee -a "${FILE}"
|
2025-11-17 16:20:24 +01:00
|
|
|
|
|
|
|
|
# Concatenate the files
|
|
|
|
|
- name: Generate resulting NEWS.rst.part
|
|
|
|
|
shell: bash
|
|
|
|
|
run: |
|
|
|
|
|
echo "Building changes to NEWS.rst file"
|
|
|
|
|
echo "NEWS" > /tmp/lpnews.$$
|
|
|
|
|
echo -e "====\n" >> /tmp/lpnews.$$
|
|
|
|
|
for filepart in head summary notes contributers translators changes
|
|
|
|
|
do
|
|
|
|
|
cat "NEWS.rst.$filepart" >> /tmp/lpnews.$$
|
|
|
|
|
done
|
|
|
|
|
cat /tmp/lpnews.$$ > /tmp/lpnews2.$$
|
|
|
|
|
cp /tmp/lpnews.$$ LATEST-NEWS.rst
|
|
|
|
|
echo "Cut 2 lines from original NEWS.rst file" | tee -a $LOG
|
|
|
|
|
cat NEWS.rst | sed -e '1,2d' >> /tmp/lpnews2.$$
|
|
|
|
|
echo "Check NEWS.rst file before continueing..."
|
|
|
|
|
cp /tmp/lpnews2.$$ NEWS.rst
|
|
|
|
|
|
|
|
|
|
# Upload the result
|
|
|
|
|
- name: Upload NEWS.rst
|
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
|
with:
|
|
|
|
|
name: NEWS.rst
|
|
|
|
|
path: NEWS.rst
|
|
|
|
|
compression-level: 0 # no compression
|
|
|
|
|
retention-days: 3
|
|
|
|
|
|
|
|
|
|
- name: Upload LATEST-NEWS.rst
|
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
|
with:
|
2025-11-18 15:38:21 +01:00
|
|
|
name: LATEST-NEWS-for-${{ vars.short_new_release }}.rst
|
2025-11-17 16:20:24 +01:00
|
|
|
path: LATEST-NEWS.rst
|
|
|
|
|
compression-level: 0 # no compression
|
|
|
|
|
retention-days: 3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|