2024-03-06 12:45:38 -05:00
|
|
|
name: Release Notes
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2024-03-07 04:17:59 -05:00
|
|
|
inputs:
|
|
|
|
from:
|
2024-09-29 23:18:20 -04:00
|
|
|
description: "Starting ref (exclusive). Can be a tag, branch or commit ref. `latest-release` refers to the last beta version bump."
|
2024-03-07 04:17:59 -05:00
|
|
|
required: true
|
2024-09-29 23:18:20 -04:00
|
|
|
default: "latest-release"
|
2024-03-07 04:17:59 -05:00
|
|
|
type: string
|
|
|
|
to:
|
2024-09-29 23:18:20 -04:00
|
|
|
description: "Ending ref (inclusive). Can be a tag, branch or commit ref. `HEAD` refers to the most recent commit."
|
2024-03-07 04:17:59 -05:00
|
|
|
required: true
|
2024-09-29 23:18:20 -04:00
|
|
|
default: "HEAD"
|
2024-03-07 04:17:59 -05:00
|
|
|
type: string
|
2024-03-06 12:45:38 -05:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: run
|
2024-09-29 23:18:20 -04:00
|
|
|
runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-latest') || 'debian-12' }}
|
2024-03-06 12:45:38 -05:00
|
|
|
container: discourse/discourse_test:slim
|
|
|
|
timeout-minutes: 10
|
2024-03-07 04:58:00 -05:00
|
|
|
env:
|
|
|
|
from_ref: ${{ inputs.from || 'latest-release' }}
|
|
|
|
to_ref: ${{ inputs.to || 'HEAD' }}
|
2024-03-06 12:45:38 -05:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Set working directory owner
|
|
|
|
run: chown root:root .
|
|
|
|
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Bundler cache
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: vendor/bundle
|
|
|
|
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
|
|
|
restore-keys: ${{ runner.os }}-gem-
|
|
|
|
|
|
|
|
- name: Setup gems
|
|
|
|
run: |
|
|
|
|
bundle config --local path vendor/bundle
|
|
|
|
bundle config --local deployment true
|
|
|
|
bundle config --local without development
|
|
|
|
bundle install --jobs 4
|
|
|
|
bundle clean
|
|
|
|
|
|
|
|
- name: Create output dir
|
|
|
|
run: mkdir -p tmp/notes
|
|
|
|
|
|
|
|
- name: Core release notes
|
2024-03-07 04:58:00 -05:00
|
|
|
run: bin/rake "release_note:generate[ $from_ref , $to_ref ]" | tee tmp/notes/core.txt
|
2024-03-06 12:45:38 -05:00
|
|
|
|
|
|
|
- name: Calculate from/to dates from refs
|
|
|
|
id: dates
|
|
|
|
run: |
|
2024-03-07 04:58:00 -05:00
|
|
|
from=$(git show -s --date=format:'%Y-%m-%d' --format=%cd "${from_ref}^{commit}")
|
2024-03-06 12:45:38 -05:00
|
|
|
echo "from=$from" >> $GITHUB_OUTPUT
|
2024-03-07 04:58:00 -05:00
|
|
|
to=$(git show -s --date=format:'%Y-%m-%d' --format=%cd "${to_ref}^{commit}")
|
2024-03-06 12:45:38 -05:00
|
|
|
echo "to=$to" >> $GITHUB_OUTPUT
|
|
|
|
|
|
|
|
- name: Setup all-the-plugins
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/discourse/all-the-plugins tmp/all-the-plugins
|
|
|
|
cd tmp/all-the-plugins
|
|
|
|
./reset-all-repos
|
|
|
|
|
|
|
|
- name: Plugin release notes
|
|
|
|
run: |
|
|
|
|
bin/rake "release_note:plugins:generate[ ${{ steps.dates.outputs.from }} , ${{ steps.dates.outputs.to }} , ./tmp/all-the-plugins/official/* , discourse ]" | tee tmp/notes/plugins.txt
|
|
|
|
|
|
|
|
- name: Export files
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: release-notes
|
|
|
|
path: ./tmp/notes/*.txt
|
|
|
|
|
|
|
|
- name: Write summary
|
|
|
|
run: |
|
2024-03-07 04:58:00 -05:00
|
|
|
echo "### Release notes" >> $GITHUB_STEP_SUMMARY
|
|
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
|
|
|
echo "From: $from_ref - $(git rev-parse --short $from_ref) - ${{ steps.dates.outputs.from }}" >> $GITHUB_STEP_SUMMARY
|
|
|
|
echo "To: $to_ref - $(git rev-parse --short $to_ref) - ${{ steps.dates.outputs.to }}" >> $GITHUB_STEP_SUMMARY
|
2024-09-29 23:18:20 -04:00
|
|
|
|
2024-03-07 04:58:00 -05:00
|
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
|
|
echo "---" >> $GITHUB_STEP_SUMMARY
|
|
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
2024-03-06 12:45:38 -05:00
|
|
|
echo "Core:" >> $GITHUB_STEP_SUMMARY
|
|
|
|
echo '~~~' >> $GITHUB_STEP_SUMMARY
|
|
|
|
cat tmp/notes/core.txt >> $GITHUB_STEP_SUMMARY
|
|
|
|
echo '~~~' >> $GITHUB_STEP_SUMMARY
|
|
|
|
echo ""
|
|
|
|
echo "Plugins:" >> $GITHUB_STEP_SUMMARY
|
|
|
|
echo '~~~' >> $GITHUB_STEP_SUMMARY
|
|
|
|
cat tmp/notes/plugins.txt >> $GITHUB_STEP_SUMMARY
|
|
|
|
echo '~~~' >> $GITHUB_STEP_SUMMARY
|