Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finalize the automagic changelogs for the deployment branches #6372

Merged
merged 17 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name: Documentation - Generate changelog
on:
workflow_dispatch:
inputs:
reference:
reference:
required: true
type: choice
default: develop
Expand All @@ -35,19 +35,19 @@ on:

workflow_call:
inputs:
reference:
reference:
required: true
type: string
default: develop
description: The reference (branch or tag) to use to compile the changelog snippets from

pull_request:
paths:
- "changelog/snippets/*.md"
push:
branches:
- deploy/fafdevelop

jobs:
verify:
name: Verify snippets
Expand All @@ -71,7 +71,7 @@ jobs:
changelog/snippets

- name: Update environment path
run: |
run: |
ls
echo "${{ github.workspace }}/scripts/.github/workflows/scripts" >> $GITHUB_PATH

Expand Down Expand Up @@ -102,18 +102,26 @@ jobs:
changelog/snippets

- name: Update environment path
run: |
run: |
echo "${{ github.workspace }}/scripts/.github/workflows/scripts" >> $GITHUB_PATH

# We need to do this to remove `deploy/` from the reference. Specifically the `/` is problematic
- name: Update reference
run: |
REFERENCE="${{ inputs.reference }}"
NAME="${REFERENCE#deploy/}"
echo "NAME=$NAME" >> $GITHUB_ENV

- name: Create the changelog
working-directory: fa/changelog/snippets # script assumes it is in this directory
run: |
changelog-combine.sh
echo $NAME
echo ${{ env.NAME }}
changelog-combine.sh ${{ env.NAME }}

- name: Add the changelog as an artifact
uses: actions/upload-artifact@v4
with:
# we need to remove `deploy/` from the reference
name: changelog-${{ (inputs.reference == 'deploy/fafdevelop' && 'fafdevelop') || (inputs.reference == 'deploy/fafbeta' && 'fafbeta') || inputs.reference }}
name: changelog-${{ env.NAME }}
path: |
fa/changelog/snippets/faf-develop.md
fa/changelog/snippets/${{ env.NAME }}.md
9 changes: 5 additions & 4 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,19 @@ jobs:
uses: actions/download-artifact@v4
with:
name: changelog-fafdevelop
path: raw-changelog-fafdevelop
path: docs/generated

- name: Download artifact changelog of FAF Beta
uses: actions/download-artifact@v4
with:
name: changelog-fafbeta
path: raw-changelog-fafbeta
path: docs/generated

- name: Append the generated changelogs
run: |
cat raw-changelog-fafdevelop >> changelogs/fafdevelop.md
cat raw-changelog-fafbeta >> changelogs/fafbeta.md
ls -Rla generated
cat generated/fafdevelop.md >> changelogs/fafdevelop.md
cat generated/fafbeta.md >> changelogs/fafbeta.md

- name: Setup Ruby
uses: ruby/setup-ruby@v1
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/scripts/changelog-combine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ process_snippets() {
}

# Output file name
output="faf-develop.md"
output="changelog.md"
if [ "$1" ]; then
output="$1.md"
fi

echo "Writing output to: $output"

rm -f "$output"

# Add the initial header
Expand Down
10 changes: 10 additions & 0 deletions test-draft.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

REFERENCE="deploy/fafdevelop"
NAME="${REFERENCE#deploy/}"
echo "$NAME"
echo "TEST"




Loading