diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index abcc32cf3..52216b36d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,12 +21,11 @@ jobs: project_version: ${{ steps.info.outputs.project_version }} mcversion: ${{ steps.info.outputs.mcversion }} tag: ${{ steps.version.outputs.tag }} - changelog: ${{ steps.changelog.outputs.description }} + news: ${{ steps.changelog.outputs.news }} + changelog: ${{ steps.changelog_full.outputs.description }} steps: - - name: Checkout with fetch depth 2 + - name: Checkout uses: actions/checkout@v4.1.1 - with: - fetch-depth: 2 - name: Get tag id: version @@ -56,179 +55,19 @@ jobs: echo "project_version=build.${{ github.run_number }}" >> $GITHUB_OUTPUT fi - - name: Checkout with fetch depth 0 - uses: actions/checkout@v4.1.1 - with: - fetch-depth: 0 - # - name: Process changelog - # id: mod_changes - # shell: bash - # run: | - # set +e - - # curl https://github.com/josephburnett/jd/releases/download/v1.7.1/jd-amd64-linux -o ./pax/jd -L -J - # sudo chmod +x ./pax/jd - - # manifest="./.github/buildtools/modpackmanifest.json" - # changelog="./CHANGELOG.md" - - # branch=$(git rev-parse --abbrev-ref HEAD) - # current_commit=$(git rev-parse --short ${{ github.sha }}) - # previous_commit=$(git log -n 1 --skip 1 --pretty=format:"%h" -- $manifest) - # latest_commit=$(git log -n 1 --pretty=format:"%h" $branch -- $manifest) - # latest_tag=$(git describe --tags --abbrev=0) - # latest_tagged_commit=$(git rev-list -n 1 --pretty=format:"%h" $latest_tag | sed -n 2p) - - # if [ "$latest_tag" = ${{ steps.version.outputs.tag }} ]; then - # latest_tag=$(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^) - # latest_tagged_commit=$(git rev-list -n 1 --pretty=format:"%h" $latest_tag | sed -n 2p) - # fi - - # if [ "$latest_commit" = "$current_commit" ]; then - # echo "changed=true" >> $GITHUB_OUTPUT - # else - # echo "changed=false" >> $GITHUB_OUTPUT - # fi - - # echo "branch: $branch" - # echo "current commit: $current_commit" - # echo "previous commit: $previous_commit" - # echo "latest commit: $latest_commit" - # echo "latest tagged commit: $latest_tagged_commit" - # echo "latest tag: $latest_tag" - - # RED='\033[0;31m' - # GREEN='\033[0;32m' - # BLUE='\033[0;36m' - # NC='\033[0m' - - # git show $latest_tagged_commit:$manifest > ./.github/buildtools/modpackmanifest_prev.json - # mods_removed_raw=$(./pax/jd -set ./.github/buildtools/modpackmanifest_prev.json $manifest | grep '^-' | grep -P -o '"name":[\s]*"\K[^"]*' | tr -d '\[\]') - # mods_added_raw=$(./pax/jd -set ./.github/buildtools/modpackmanifest_prev.json $manifest | grep '^+' | grep -P -o '"name":[\s]*"\K[^"]*' | tr -d '\[\]') - - # mods_added="" - # mods_removed="" - # mods_updated="" - - # mod_changes="" - - # if [[ ! -z ""$mods_added_raw"" ]]; then - # while IFS= read -r line1; do - # foo="" - # while IFS= read -r line2; do - # foo="${line1//$line2}" - # if [[ -z ""$foo"" ]]; then - # if [[ ! -z ""$mods_updated"" ]]; then - # mods_updated+="\n" - # fi - # mods_updated+="- $line1" - # break - # fi - # done <<< "$mods_removed_raw" - # if [[ ! -z ""$foo"" ]]; then - # if [[ ! -z ""$mods_added"" ]]; then - # mods_added+="\n" - # fi - # mods_added+="- $foo" - # fi - # done <<< "$mods_added_raw" - # fi - - # if [[ ! -z ""$mods_removed_raw"" ]]; then - # while IFS= read -r line1; do - # bar="" - # while IFS= read -r line2; do - # bar="${line1//$line2}" - # if [[ -z ""$bar"" ]]; then - # break - # fi - # done <<< "$mods_added_raw" - # if [[ ! -z ""$bar"" ]]; then - # if [[ ! -z ""$mods_removed"" ]]; then - # mods_removed+="\n" - # fi - # mods_removed+="- $bar" - # fi - # done <<< "$mods_removed_raw" - # fi - - # if [[ ! -z ""$mods_added"" ]] || [[ ! -z ""$mods_removed"" ]] || [[ ! -z ""$mods_updated"" ]]; then - # echo -e "x---------------x" - # echo -e "| Mod Changes |" - - # mod_changes+="## Mod Changes\n\n" - # mod_changes+="Since: [\`$latest_tag\`]()\n\n" - # mod_changes+="\`\`\`markdown\n" - # fi - - # if [[ ! -z ""$mods_added"" ]]; then - # echo -e "${GREEN}Added:" - # echo -e "$mods_added" - - # mod_changes+="Added:\n" - # mod_changes+="$mods_added\n" - - # if [[ ! -z ""$mods_removed"" ]] || [[ ! -z ""$mods_updated"" ]]; then - # mod_changes+="\n" - # fi - # fi - # if [[ ! -z ""$mods_removed"" ]]; then - # echo -e "${RED}Removed:" - # echo -e "$mods_removed" - - # mod_changes+="Removed:\n" - # mod_changes+="$mods_removed\n" - - # if [[ ! -z ""$mods_updated"" ]]; then - # mod_changes+="\n" - # fi - # fi - # if [[ ! -z ""$mods_updated"" ]]; then - # echo -e "${BLUE}Updated:" - # echo -e "$mods_updated" - - # mod_changes+="Updated:\n" - # mod_changes+="$mods_updated\n" - # fi - - # if [[ ! -z ""$mods_added"" ]] || [[ ! -z ""$mods_removed"" ]] || [[ ! -z ""$mods_updated"" ]]; then - # echo -e "${NC}x---------------x" - - # mod_changes+="\`\`\`" - # fi - - # if [[ ! -z ""$mod_changes"" ]]; then - # echo -e "$mod_changes" >> $GITHUB_STEP_SUMMARY - # fi - - # # Upload @mod_changes@ - # mod_changes=$(echo $mod_changes | sed -r 's/[/]/\\\//g') - # perl -i -pe "s/\@mod_changes\@/$mod_changes/g" $changelog - - # # Replace @mod_changes@ - # mod_changes=$(echo $mod_changes | sed -r 's/\\\\n/\\n/g') - # echo "markdown=$mod_changes" >> $GITHUB_OUTPUT - - # rm ./.github/buildtools/modpack/manifest_prev.json - - # # Replace @version@ - # perl -i -pe "s/\@version\@/${{ steps.info.outputs.projectsuffix }}/g" $changelog - - # # Finally, Rename changelog - # mv $changelog CHANGELOG-${{ steps.info.outputs.projectsuffix }}.md - # - name: Upload changelog - # uses: actions/upload-artifact@v4.0.0 - # with: - # name: changelog - # path: CHANGELOG-${{ steps.info.outputs.projectsuffix }}.md - # retention-days: 5 - - name: Changelog Parser - id: changelog + id: changelog_full uses: coditory/changelog-parser@v1.0.2 with: path: CHANGELOG.md + - name: Extract changes + id: changelog + run: | + changelog_full=${{ steps.changelog_full.outputs.description }} + news=$(echo "$changelog_full" | grep -oP '### Изменения([\s\S]*?)(?=### Новые моды|### Обновленные моды|### Удаленные моды)') + echo news=$news >> $GITHUB_OUTPUT + build-cf-modpack: name: Build CF Modpack runs-on: ubuntu-latest @@ -340,13 +179,14 @@ jobs: release: name: Release needs: [modpack-info, build-cf-modpack, build-mmc-modpack, build-serverpack] - #if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') uses: ./.github/workflows/release.yml with: project_name: ${{ needs.modpack-info.outputs.project_name }} project_version: ${{ needs.modpack-info.outputs.project_version }} mcversion: ${{ needs.modpack-info.outputs.mcversion }} tag: ${{ needs.modpack-info.outputs.tag }} + news: ${{ needs.modpack-info.outputs.news }} changelog: ${{ needs.modpack-info.outputs.changelog }} secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0ccf5bd6e..c6f335f5d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,9 @@ on: tag: required: true type: string + news: + required: true + type: string changelog: required: true type: string @@ -93,11 +96,13 @@ jobs: id: message shell: bash run: | - message="## **${{ inputs.project_name }}** has been updated to ${{ inputs.project_version }}! :tada: " - message+="\n[CurseForge]() • " - message+="[GitHub]() • " - message+="[Issues]()" - echo "markdown=$message" >> $GITHUB_OUTPUT + header="## **${{ inputs.project_name }}** has been updated to ${{ inputs.project_version }}! :tada:" + echo "header=$header" >> $GITHUB_OUTPUT + + link+="[CurseForge]() • " + link+="[GitHub]() • " + link+="[Issues]()" + echo "link=$link" >> $GITHUB_OUTPUT - name: Send Discord message uses: hugoalh/send-discord-webhook-ghaction@v6.0.1 @@ -105,13 +110,7 @@ jobs: key: "${{secrets.RELEASES_1_20}}" username: "TerraFirmaGreg" avatar_url: "https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/logo_new_year.png" - content: "${{ steps.message.outputs.markdown }}\n${{ inputs.changelog }}" - embeds: | - [ - { - "description": "${{ inputs.changelog }}", - } - ] + content: "${{ steps.message.outputs.header }}\n${{ steps.message.outputs.link }}\n${{ inputs.news }}" # release-modrinth: # name: Deploy to Modrinth diff --git a/CHANGELOG.md b/CHANGELOG.md index 16f43a4b6..5d8fdea06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,38 @@ - Полублоки, ступени, стены и другие блоки теперь могут осыпаться. - Добавлены бедные и богатые куски руд с их переработкой. - И еще множество всего, чего я забыл. +### Удаленные моды +- TFShips +- smallships +- ad_astra +- botarium +- resourcefulconfig +- resourcefullib +### Новые моды +- AdditionalPlacements +- EnhancedVisuals +- PlayerRevive +- cc-tweaked +- chisels-and-bits +- createaddition +- gcyr +- kubejs-create +- lootjs +- starlight +### Обновленные моды +- CreativeCore -> 2.11.18 +- Cucumber -> 7.0.7 +- FirmaCivilization -> 0.1.10 +- Jade -> 11.7.1 +- TerraFirmaGreg-Core -> 0.2.4 +- appliedenergistics2 -> 15.0.18 +- astikorcarts-redux -> 1.1.7 +- curios -> 5.4.7 +- embeddium -> 0.2.16 +- exposure -> 1.2.2 +- gtceu -> 1.0.19.b +- sophisticatedbackpacks -> 3.19.5.988 +- sophisticatedcore -> 0.5.113.524 ## [0.3.0] - 26.12.2023 ### Изменения