diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml index 90cf99b5e1..4a566e8112 100644 --- a/.github/workflows/changelog.yaml +++ b/.github/workflows/changelog.yaml @@ -23,7 +23,7 @@ name: Documentation - Generate changelog on: workflow_dispatch: inputs: - reference: + reference: required: true type: choice default: develop @@ -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 @@ -71,7 +71,7 @@ jobs: changelog/snippets - name: Update environment path - run: | + run: | ls echo "${{ github.workspace }}/scripts/.github/workflows/scripts" >> $GITHUB_PATH @@ -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 diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index 22626b090a..8253964827 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -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 diff --git a/.github/workflows/scripts/changelog-combine.sh b/.github/workflows/scripts/changelog-combine.sh index 0c4b9c4eec..a1926560dd 100755 --- a/.github/workflows/scripts/changelog-combine.sh +++ b/.github/workflows/scripts/changelog-combine.sh @@ -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 diff --git a/test-draft.sh b/test-draft.sh new file mode 100644 index 0000000000..15481e8ed4 --- /dev/null +++ b/test-draft.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +REFERENCE="deploy/fafdevelop" +NAME="${REFERENCE#deploy/}" +echo "$NAME" +echo "TEST" + + + +