diff --git a/.github/workflows/Build.CelesteStudio.yml b/.github/workflows/Build.CelesteStudio.yml index 9e298588..5c71f4c9 100644 --- a/.github/workflows/Build.CelesteStudio.yml +++ b/.github/workflows/Build.CelesteStudio.yml @@ -29,6 +29,15 @@ jobs: run: sed -i "s/-dev/-$(git rev-parse --short HEAD)/" Studio/CelesteStudio/Studio.cs if: ${{ inputs.build-cfg == 'Debug' }} + - name: Download changelog + uses: actions/download-artifact@v4 + with: + pattern: changelog-studio + if: ${{ inputs.build-cfg == 'Release' }} + - name: Move changelog into Assets + run: mv changelog-studio/studio_changelog.md Studio/CelesteStudio/Assets/Changelog.md + if: ${{ inputs.build-cfg == 'Release' }} + - name: Publish x64 run: dotnet publish Studio/CelesteStudio.WPF -c ${{ inputs.build-cfg }} -r win-x64 --output build-x64 diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index acaa7466..79a5f281 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -6,14 +6,61 @@ on: - "v*.*.*" jobs: + generate-changelog: + runs-on: ubuntu-latest + + steps: + - name: Setup Python + uses: actions/setup-python@v5.2.0 + with: + python-version: 3.12.6 + - name: Setup Python environment + run: | + python -m venv .venv + source .venv/bin/activate + pip install requests + + - name: Generate release-changelog + run: | + source .venv/bin/activate + python Scripts/generate_release.py "$(git log -1 --pretty=%B)" version_info.txt gamebanana_changelog.json github_changelog.md studio_changelog.md + env: + GITHUB_REPO: ${{ github.repository }} + GITHUB_TOKEN: ${{ github.token }} + + - name: Upload version information + uses: actions/upload-artifact@v4 + with: + name: changelog-version + path: version_info.txt + - name: Upload GameBanana changelog + uses: actions/upload-artifact@v4 + with: + name: changelog-gamebanana + path: gamebanana_changelog.json + - name: Upload GitHub changelog + uses: actions/upload-artifact@v4 + with: + name: changelog-github + path: github_changelog.md + - name: Upload Studio changelog + uses: actions/upload-artifact@v4 + with: + name: changelog-studio + path: studio_changelog.md + + build-studio: uses: ./.github/workflows/Build.CelesteStudio.yml with: build-cfg: Release + needs: generate-changelog release: runs-on: ubuntu-latest - needs: build-studio + needs: + - build-studio + - generate-changelog steps: - name: Checkout @@ -61,20 +108,17 @@ jobs: run: | dotnet build CelesteTAS-EverestInterop -c Release -p:DefineConstants=INSTALL_STUDIO -p:UseSymlinks=false + - name: Download changelogs + uses: actions/download-artifact@v4 + with: + pattern: changelog-* + - name: Setup Python environment run: | python -m venv .venv source .venv/bin/activate pip install requests selenium - - name: Generate release-changelog - run: | - source .venv/bin/activate - python Scripts/generate_release.py "$(git log -1 --pretty=%B)" version_info.txt gamebanana_changelog.json github_changelog.md - env: - GITHUB_REPO: ${{ github.repository }} - GITHUB_TOKEN: ${{ github.token }} - - name: Prepare releases run: | # Version GameBanana .zip without v prefix @@ -89,7 +133,7 @@ jobs: - name: Upload GameBanana release run: | source .venv/bin/activate - python Scripts/gamebanana_upload.py ${{ env.RELEASE_FILE }} gamebanana_changelog.json version_info.txt + python Scripts/gamebanana_upload.py ${{ env.RELEASE_FILE }} changelog-gamebanana/gamebanana_changelog.json changelog-version/version_info.txt env: GAMEBANANA_USERNAME: AutomaticRelease GAMEBANANA_PASSWORD: ${{ secrets.GAMEBANANA_PASSWORD }} @@ -101,7 +145,7 @@ jobs: uses: softprops/action-gh-release@v1 with: name: ${{ env.RELEASE_TITLE }} - body_path: github_changelog.md + body_path: changelog-github/github_changelog.md files: | CelesteTAS.zip CelesteStudio-windows-x64.zip diff --git a/Scripts/generate_release.py b/Scripts/generate_release.py index bde1dea8..fc50253c 100644 --- a/Scripts/generate_release.py +++ b/Scripts/generate_release.py @@ -35,6 +35,7 @@ def main(): version_info_file = sys.argv[2] gb_changelog_file = sys.argv[3] gh_changelog_file = sys.argv[4] + studio_changelog_file = sys.argv[5] # Find CelesteTAS / Studio version celestetas_version = re.search(r"CelesteTAS\s+(v[\d.]+)", commit_message).group(1) @@ -136,6 +137,10 @@ def main(): break # No more pages left break + # Only include release notes (and not commit details) in Studio changelog + with open(studio_changelog_file, "w") as f: + f.write("\n".join(gh_markdown)) + # Generate commit details gh_markdown.append("
") gh_markdown.append("

Commit Details

")