From 0698fd658dce8ab37d07b8493942b3dba65197c4 Mon Sep 17 00:00:00 2001 From: Xikaro <0regon.end@gmail.com> Date: Thu, 14 Dec 2023 17:30:51 +0500 Subject: [PATCH] workflows --- .github/workflows/preview copy.yml | 74 ++++++++++++++++++++++++++++++ .github/workflows/preview.yml | 54 ++-------------------- 2 files changed, 77 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/preview copy.yml diff --git a/.github/workflows/preview copy.yml b/.github/workflows/preview copy.yml new file mode 100644 index 000000000..d3ed55f4c --- /dev/null +++ b/.github/workflows/preview copy.yml @@ -0,0 +1,74 @@ +# name: Deploy modpack preview + +# on: +# push: +# tags: +# - "Pre*" + +# jobs: +# Deploy: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v4.1.1 + +# - name: Get the version +# id: get_version +# run: echo ::set-output name=version::${GITHUB_REF#refs/tags/Pre} + +# - name: Set the version +# run: | +# DEV=${{ steps.get_version.outputs.version }} +# sed -i -e "s/DEV/${DEV}/g" pack.toml +# sed -i -e "s/DEV/${DEV}/g" config/fancymenu/customization/main_menu.txt +# sed -i -e "s/DEV/${DEV}/g" config/bcc-common.toml + +# - name: Changelog Parser +# id: changelog +# uses: coditory/changelog-parser@v1.0.2 +# with: +# path: CHANGELOG.md + +# - name: Set up Go 1.19 +# id: go +# uses: actions/setup-go@v5.0.0 +# with: +# go-version: 1.19 +# - run: go install github.com/packwiz/packwiz@latest + +# - name: Archive CF +# run: | +# cd ./ +# packwiz curseforge export -o TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-cf.zip + +# - name: Archive MMC +# run: | +# git submodule init +# cd mods +# git config --local credential.helper '!f() { sleep 1; echo "password=USER_TOKEN_XIKARO"; }; f' +# git config --local http.https://github.com.Xikaro.extraheader "AUTHORIZATION: basic $(git credential-cache get)" +# git config --local url."https://github.com/Xikaro:USER_TOKEN_XIKARO@github.com".insteadOf "https://github.com/TerraFirmaGreg-Team/TFG-Mods-1.20.x" +# git submodule update --recursive +# mkdir -p .minecraft +# cp -r ./{config,defaultconfigs,kubejs,mods,.github/buildtools/modpack/mmc-pack.json,.github/buildtools/modpack/instance.cfg} .minecraft/ +# zip -r ./TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-mmc.zip .minecraft/ + +# - name: Archive Server +# run: | +# cp -r .github/buildtools/serverpack/* .minecraft/ +# cat .github/buildtools/client_mod.txt | while read -r line; do find .minecraft/mods -name "$line" -delete; done +# cd .minecraft/ +# zip -r ../TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-server.zip ./ + +# - name: Create GitHub Release +# uses: softprops/action-gh-release@v0.1.15 +# if: startsWith(github.ref, 'refs/tags/') +# with: +# prerelease: true +# generate_release_notes: true +# name: Release ${{ steps.changelog.outputs.version }} +# body: ${{ steps.changelog.outputs.description }} +# files: | +# ./TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-cf.zip +# ./TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-mmc.zip +# ./TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-server.zip diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 5e3367373..15f2eac50 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -16,59 +16,11 @@ jobs: id: get_version run: echo ::set-output name=version::${GITHUB_REF#refs/tags/Pre} - - name: Set the version - run: | - DEV=${{ steps.get_version.outputs.version }} - sed -i -e "s/DEV/${DEV}/g" pack.toml - sed -i -e "s/DEV/${DEV}/g" config/fancymenu/customization/main_menu.txt - sed -i -e "s/DEV/${DEV}/g" config/bcc-common.toml - - - name: Changelog Parser - id: changelog - uses: coditory/changelog-parser@v1.0.2 - with: - path: CHANGELOG.md - - - name: Set up Go 1.19 - id: go - uses: actions/setup-go@v5.0.0 - with: - go-version: 1.19 - - run: go install github.com/packwiz/packwiz@latest - - - name: Archive CF - run: | - cd ./ - packwiz curseforge export -o TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-cf.zip - - name: Archive MMC run: | git submodule init cd mods - git config --local credential.helper '!f() { sleep 1; echo "password=USER_TOKEN_XIKARO"; }; f' + git config --local credential.helper '!f() { sleep 1; echo "password=secrets.USER_TOKEN_XIKARO"; }; f' git config --local http.https://github.com.Xikaro.extraheader "AUTHORIZATION: basic $(git credential-cache get)" - git config --local url."https://github.com/Xikaro:USER_TOKEN_XIKARO@github.com".insteadOf "https://github.com/TerraFirmaGreg-Team/TFG-Mods-1.20.x" - git submodule update --recursive - mkdir -p .minecraft - cp -r ./{config,defaultconfigs,kubejs,mods,.github/buildtools/modpack/mmc-pack.json,.github/buildtools/modpack/instance.cfg} .minecraft/ - zip -r ./TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-mmc.zip .minecraft/ - - - name: Archive Server - run: | - cp -r .github/buildtools/serverpack/* .minecraft/ - cat .github/buildtools/client_mod.txt | while read -r line; do find .minecraft/mods -name "$line" -delete; done - cd .minecraft/ - zip -r ../TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-server.zip ./ - - - name: Create GitHub Release - uses: softprops/action-gh-release@v0.1.15 - if: startsWith(github.ref, 'refs/tags/') - with: - prerelease: true - generate_release_notes: true - name: Release ${{ steps.changelog.outputs.version }} - body: ${{ steps.changelog.outputs.description }} - files: | - ./TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-cf.zip - ./TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-mmc.zip - ./TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-server.zip + git config --local url."https://github.com/Xikaro:secrets.USER_TOKEN_XIKARO@github.com".insteadOf "https://github.com/TerraFirmaGreg-Team/TFG-Mods-1.20.x" + git submodule update --recursive \ No newline at end of file