Skip to content

Commit

Permalink
workflows final
Browse files Browse the repository at this point in the history
  • Loading branch information
Xikaro committed Jan 5, 2024
1 parent 4611d42 commit 9883308
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 149 deletions.
255 changes: 122 additions & 133 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
project_version: ${{ steps.info.outputs.project_version }}
mcversion: ${{ steps.info.outputs.mcversion }}
tag: ${{ steps.version.outputs.tag }}
news: ${{ steps.message.outputs.news }}
changelog: ${{ steps.changelog.outputs.description }}
steps:
- name: Checkout
Expand Down Expand Up @@ -61,138 +60,128 @@ jobs:
uses: coditory/changelog-parser@v1.0.2
with:
path: CHANGELOG.md

- name: Send Discord message
uses: tsickert/discord-webhook@v5.4.0


build-cf-modpack:
name: Build CF Modpack
runs-on: ubuntu-latest
needs: [modpack-info]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1

- name: Replace strings
shell: bash
run: |
VERSION=${{ needs.modpack-info.outputs.project_version }}
sed -i -e "s/DEV/${VERSION}/g" .github/buildtools/modpack/manifest.json
sed -i -e "s/DEV/${VERSION}/g" config/fancymenu/customization/main_menu.txt
sed -i -e "s/DEV/${VERSION}/g" config/bcc-common.toml
- name: Export CF
run: |
mkdir -p overrides
mv -vf {config,defaultconfigs,kubejs} overrides/
mv -vf .github/buildtools/modpack/manifest.json ./
mv -vf .github/buildtools/modpack/modlist.html ./
zip -r ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf.zip manifest.json modlist.html overrides
- name: Upload zip cf
uses: actions/upload-artifact@v4.0.0
with:
webhook-url: ${{secrets.RELEASES_1_20}}
username: "TerraFirmaGreg"
avatar-url: "https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/logo_new_year.png"
embed-title: Release ${{ steps.changelog.outputs.version }}
embed-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.20.x/releases/tag/0.4.0
embed-description: "${{ steps.changelog.outputs.description }}"
embed-color: 5814783

# build-cf-modpack:
# name: Build CF Modpack
# runs-on: ubuntu-latest
# needs: [modpack-info]
# steps:
# - name: Checkout
# uses: actions/checkout@v4.1.1

# - name: Replace strings
# shell: bash
# run: |
# VERSION=${{ needs.modpack-info.outputs.project_version }}
# sed -i -e "s/DEV/${VERSION}/g" .github/buildtools/modpack/manifest.json
# sed -i -e "s/DEV/${VERSION}/g" config/fancymenu/customization/main_menu.txt
# sed -i -e "s/DEV/${VERSION}/g" config/bcc-common.toml

# - name: Export CF
# run: |
# mkdir -p overrides
# mv -vf {config,defaultconfigs,kubejs} overrides/
# mv -vf .github/buildtools/modpack/manifest.json ./
# mv -vf .github/buildtools/modpack/modlist.html ./
# zip -r ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf.zip manifest.json modlist.html overrides

# - name: Upload zip cf
# uses: actions/upload-artifact@v4.0.0
# with:
# name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf
# path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf.zip
# retention-days: 5

# build-mmc-modpack:
# name: Build MMC Modpack
# runs-on: ubuntu-latest
# needs: [modpack-info]
# steps:
# - name: Checkout
# uses: actions/checkout@v4.1.1

# - name: Replace strings
# shell: bash
# run: |
# VERSION=${{ needs.modpack-info.outputs.project_version }}
# sed -i -e "s/DEV/${VERSION}/g" .github/buildtools/modpack/instance.cfg
# sed -i -e "s/DEV/${VERSION}/g" config/fancymenu/customization/main_menu.txt
# sed -i -e "s/DEV/${VERSION}/g" config/bcc-common.toml

# - name: Download Mods
# run: |
# git submodule init
# cd mods
# git config --global credential.helper '!f() {
# echo "username=Xikaro";
# echo "password=${{ secrets.USER_TOKEN_XIKARO }}"; }; f'
# git submodule update --recursive

# - name: Export MMC
# run: |
# mkdir -p .minecraft
# mv -vf {config,defaultconfigs,kubejs,mods} .minecraft/
# mv -vf .github/buildtools/modpack/mmc-pack.json ./
# mv -vf .github/buildtools/modpack/instance.cfg ./
# zip -r ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-mmc.zip mmc-pack.json instance.cfg .minecraft/
name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf
path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf.zip
retention-days: 5

build-mmc-modpack:
name: Build MMC Modpack
runs-on: ubuntu-latest
needs: [modpack-info]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1

- name: Replace strings
shell: bash
run: |
VERSION=${{ needs.modpack-info.outputs.project_version }}
sed -i -e "s/DEV/${VERSION}/g" .github/buildtools/modpack/instance.cfg
sed -i -e "s/DEV/${VERSION}/g" config/fancymenu/customization/main_menu.txt
sed -i -e "s/DEV/${VERSION}/g" config/bcc-common.toml
- name: Download Mods
run: |
git submodule init
cd mods
git config --global credential.helper '!f() {
echo "username=Xikaro";
echo "password=${{ secrets.USER_TOKEN_XIKARO }}"; }; f'
git submodule update --recursive
- name: Export MMC
run: |
mkdir -p .minecraft
mv -vf {config,defaultconfigs,kubejs,mods} .minecraft/
mv -vf .github/buildtools/modpack/mmc-pack.json ./
mv -vf .github/buildtools/modpack/instance.cfg ./
zip -r ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-mmc.zip mmc-pack.json instance.cfg .minecraft/
# - name: Upload zip mmc
# uses: actions/upload-artifact@v4.0.0
# with:
# name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-mmc
# path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-mmc.zip
# retention-days: 5

# build-serverpack:
# name: Build Serverpack
# runs-on: ubuntu-latest
# needs: [modpack-info]
# steps:
# - name: Checkout
# uses: actions/checkout@v4.1.1

# - name: Replace strings
# shell: bash
# run: |
# VERSION=${{ needs.modpack-info.outputs.project_version }}
# sed -i -e "s/DEV/${VERSION}/g" config/bcc-common.toml

# - name: Download Mods
# run: |
# git submodule init
# cd mods
# git config --global credential.helper '!f() {
# echo "username=Xikaro";
# echo "password=${{ secrets.USER_TOKEN_XIKARO }}"; }; f'
# git submodule update --recursive

# - name: Export serverpack
# run: |
# mkdir -p .minecraft
# mv -vf {config,defaultconfigs,kubejs,mods,.github/buildtools/serverpack/*} .minecraft
# cat .github/buildtools/client_mod.txt | while read -r line; do find .minecraft/mods -name "$line" -delete; done
# zip -r ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server.zip .minecraft/*

# - name: Upload zip
# uses: actions/upload-artifact@v4.0.0
# with:
# name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server
# path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server.zip
# retention-days: 5


# release:
# name: Release
# needs: [modpack-info, build-cf-modpack, build-mmc-modpack, build-serverpack]
# 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
- name: Upload zip mmc
uses: actions/upload-artifact@v4.0.0
with:
name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-mmc
path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-mmc.zip
retention-days: 5

build-serverpack:
name: Build Serverpack
runs-on: ubuntu-latest
needs: [modpack-info]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1

- name: Replace strings
shell: bash
run: |
VERSION=${{ needs.modpack-info.outputs.project_version }}
sed -i -e "s/DEV/${VERSION}/g" config/bcc-common.toml
- name: Download Mods
run: |
git submodule init
cd mods
git config --global credential.helper '!f() {
echo "username=Xikaro";
echo "password=${{ secrets.USER_TOKEN_XIKARO }}"; }; f'
git submodule update --recursive
- name: Export serverpack
run: |
mkdir -p .minecraft
mv -vf {config,defaultconfigs,kubejs,mods,.github/buildtools/serverpack/*} .minecraft
cat .github/buildtools/client_mod.txt | while read -r line; do find .minecraft/mods -name "$line" -delete; done
zip -r ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server.zip .minecraft/*
- name: Upload zip
uses: actions/upload-artifact@v4.0.0
with:
name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server
path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server.zip
retention-days: 5


release:
name: Release
needs: [modpack-info, build-cf-modpack, build-mmc-modpack, build-serverpack]
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

23 changes: 7 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,16 @@ jobs:
server-display-name: ${{ inputs.project_name }}-${{ inputs.project_version }}-server
release-type: ${{ env.RELEASE_TYPE }}

- name: Create Discord message
id: message
shell: bash
run: |
header="## **${{ inputs.project_name }}** был обновлен до ${{ inputs.project_version }}! :tada:"
echo "header=$header" >> $GITHUB_OUTPUT
link+="[CurseForge](<https://www.curseforge.com/minecraft/modpacks/terrafirmagreg/files/${{ steps.cf_release.outputs.id }}>) • "
link+="[GitHub](<https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.20.x/releases/tag/${{ inputs.tag }}>) • "
link+="[Issues](<https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.20.x/issues>)"
echo "link=$link" >> $GITHUB_OUTPUT
- name: Send Discord message
uses: hugoalh/send-discord-webhook-ghaction@v6.0.1
uses: tsickert/discord-webhook@v5.4.0
with:
key: "${{secrets.RELEASES_1_20}}"
webhook-url: ${{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.header }}\n${{ steps.message.outputs.link }}\n${{ inputs.news }}"
avatar-url: "https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/logo_new_year.png"
embed-title: Release ${{ inputs.project_version }}
embed-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.20.x/releases/tag/${{ inputs.tag }}
embed-description: ${{ inputs.changelog }}
embed-color: 5814783

release-github:
name: Deploy to GitHub
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [0.4.1] - 05.01.2024
### Изменения
- Исправлена кнопка подключения к официальному серверу.
- Исправлен рецепт молда для лопаты.
### Обновленные моды
- TerraFirmaGreg-Core -> 0.2.5
- notenoughanimations -> 1.7.0

## [0.4.0] - 05.01.2024
### Изменения
- Удалены из игры бронзовые паровые машины, тк позволяли скипнуть очень много прогресии TFC.
Expand Down

0 comments on commit 9883308

Please sign in to comment.