neuralgia/.github/workflows/release.yml
dependabot[bot] b91189c335
Bump the dependencies group with 2 updates
Bumps the dependencies group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/upload-artifact](https://github.com/actions/upload-artifact).


Updates `actions/checkout` from 4.2.0 to 4.2.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.2.0...v4.2.2)

Updates `actions/upload-artifact` from 4.4.0 to 4.5.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.4.0...v4.5.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-18 03:36:23 +00:00

298 lines
No EOL
12 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Build
run-name: "Build #${{ github.run_number }}"
on:
push:
tags:
- "*.*.*"
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
RELEASE_TYPE: "RELEASE"
jobs:
info:
name: Project Info
runs-on: ubuntu-latest
outputs:
project_version: ${{ steps.project_version.outputs.tag }}
project_name: ${{ steps.project_name.outputs.value }}
mc_version: ${{ steps.mc_version.outputs.value }}
changelog: ${{ steps.changelog.outputs.description }}
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Get tag
id: project_version
uses: "WyriHaximus/github-action-get-previous-tag@v1.4.0"
with:
fallback: build.${{ github.run_number }}
- name: Get project name
id: project_name
uses: ActionsTools/read-json-action@main
with:
file_path: ".github/buildtools/modpack/manifest.json"
prop_path: "name"
- name: Get project name
id: mc_version
uses: ActionsTools/read-json-action@main
with:
file_path: ".github/buildtools/modpack/manifest.json"
prop_path: "minecraft.version"
- name: Changelog Parser
id: changelog
uses: coditory/changelog-parser@v1.0.2
with:
path: CHANGELOG.md
build-curseforge:
name: Build CurseForge Pack
runs-on: ubuntu-latest
needs: [info]
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Replace strings
shell: bash
run: |
VERSION=${{ needs.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/gui_main_menu.txt
- name: Export CurseForge
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.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge.zip manifest.json modlist.html overrides
- name: Upload zip CurseForge
uses: actions/upload-artifact@v4.5.0
with:
name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge
path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge.zip
retention-days: 5
build-multimc:
name: Build MultiMC Pack
runs-on: ubuntu-latest
needs: [info]
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Replace strings
shell: bash
run: |
VERSION=${{ needs.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/gui_main_menu.txt
- 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 MultiMC
run: |
mkdir -p .minecraft
mkdir -p flame
mv -vf {config,defaultconfigs,kubejs,mods} .minecraft/
mv -vf .github/buildtools/modpack/mmc-pack.json ./
mv -vf .github/buildtools/modpack/instance.cfg ./
mv -vf .github/buildtools/modpack/modlist.html ./
mv -vf .github/buildtools/modpack/manifest.json flame/
find .minecraft/mods -name "probejs-*" -delete;
find .minecraft/mods -name ".git" -delete;
zip -r ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc.zip icon.png mmc-pack.json instance.cfg .minecraft/ flame/
- name: Upload zip multimc
uses: actions/upload-artifact@v4.5.0
with:
name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc
path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc.zip
retention-days: 5
build-server:
name: Build Server Pack
runs-on: ubuntu-latest
needs: [info]
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- 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.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server.zip .minecraft/*
- name: Upload zip
uses: actions/upload-artifact@v4.5.0
with:
name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server
path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server.zip
retention-days: 5
release-curseforge:
name: Deploy to CurseForge
needs: [info, build-curseforge, build-server]
runs-on: ubuntu-latest
outputs:
cf_release_id: ${{ steps.cf_release.outputs.id }}
steps:
- name: Check if CF_API_TOKEN exist
shell: bash
run: |
if [ "${{ secrets.CF_API_TOKEN }}" == '' ]; then
echo '::error::No value found for secret key `CF_API_TOKEN`. See https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository' && exit 1
fi
- name: Download cf modpack
uses: actions/download-artifact@v4.1.8
with:
name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge
- name: Download serverpack
uses: actions/download-artifact@v4.1.8
with:
name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server
- name: Upload Curseforge
id: cf_release
uses: Xikaro/upload-curseforge-modpack-action@1.1.1
with:
api-token: ${{ secrets.CF_API_TOKEN }}
project-id: ${{ vars.CF_MODPACK_ID }}
display-name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}
modpack-path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge.zip
server-display-name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server
modpack-server-path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server.zip
changelog: ${{ needs.info.outputs.changelog }}
changelog-format: markdown
game-version: ${{ needs.info.outputs.mc_version }}
release-type: ${{ env.RELEASE_TYPE }}
# release-modrinth:
# name: Deploy to Modrinth
# runs-on: ubuntu-latest
# steps:
# - name: Check if MODRINTH_API_TOKEN exist
# shell: bash
# run: |
# if [ "${{ secrets.MODRINTH_API_TOKEN }}" == '' ]; then
# echo '::error::No value found for secret key `MODRINTH_API_TOKEN`. See https://docs.github.com/en/ actionssecurity-guides/ encrypted-secrets#creating-encrypted-secrets-for-a-repository' && exit 1
# fi
# - name: Download modpack
# uses: actions/download-artifact@v4.1.0
# with:
# name: modpack_mrd
# - name: Download serverpack
# uses: actions/download-artifact@v4.1.0
# with:
# name: server_pack
# - name: Upload Modrinth
# id: cf_release
# uses: SwitchAlpha/upload-curseforge-modpack-action@master
# with:
# api-token: ${{ secrets.MODRINTH_API_TOKEN }}
# project-id: ${{ vars.MODRINTH_MODPACK_ID }}
# modpack-path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-mrd.zip
# modpack-server-path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server.zip
# changelog: ${{ needs.info.outputs.changelog }}
# changelog-format: markdown
# game-version: ${{ needs.info.outputs.mc_version }}
# display-name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}
# server-display-name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server
# release-type: ${{ env.RELEASE_TYPE }}
close-fixed-issues:
name: Close Fixed Issues
needs: [info, build-curseforge, build-multimc, build-server]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Сlose fixed in dev
uses: Xikaro/close-issues-based-on-label@master
env:
LABEL: "2. Status: In Dev"
COMMENT: In ${{ needs.info.outputs.project_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-github:
name: Deploy to GitHub
needs: [info, build-curseforge, build-multimc, build-server, close-fixed-issues]
runs-on: ubuntu-latest
steps:
- name: Download modpack
uses: actions/download-artifact@v4.1.8
with:
merge-multiple: true
- name: Create release
uses: softprops/action-gh-release@v2
with:
prerelease: false
generate_release_notes: true
name: ${{ needs.info.outputs.project_version }}
body: ${{ needs.info.outputs.changelog }}
files: |
${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge.zip
${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc.zip
${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server.zip
tag_name: ${{ needs.info.outputs.project_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
discord-message:
name: Discord Message
needs: [info, release-github, release-curseforge]
runs-on: ubuntu-latest
steps:
- name: Send Discord message
uses: tsickert/discord-webhook@v6.0.0
with:
webhook-url: ${{secrets.RELEASES_1_20}}
username: "TerraFirmaGreg"
avatar-url: "https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/curseforge.png"
embed-title: Release ${{ needs.info.outputs.project_version }}
embed-url: https://github.com/${{ github.repository }}/releases/tag/${{ needs.info.outputs.project_version }}
embed-thumbnail-url: https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/logo.png
embed-description: |
**Release Type**: `${{ env.RELEASE_TYPE }}`
**GameVersion**: `${{ needs.info.outputs.mc_version }}`
**Website Link**: [CurseForge](https://www.curseforge.com/minecraft/modpacks/terrafirmagreg/files/${{ needs.release-curseforge.outputs.cf_release_id }})
** Сhangelog **
```${{ needs.info.outputs.changelog }}```
** [More details...](https://github.com/TerraFirmaGreg-Team/Modpack-Modern/blob/main/CHANGELOG.md) **
embed-color: 5814783