Skip to content

build testing

build testing #10

Workflow file for this run

name: release-pipeline
on:
push:
tags:
- "v*"
jobs:
build-release-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Checkout forked EGT repo
- name: checkout forked EGT plugin
uses: actions/checkout@v4
with:
repository: Traben-0/essential-gradle-toolkit
path: forked-plugin
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
# Changelog parsing and version check
- name: check changelog & version
run: node changelog_test.js
env:
TAG_NAME: ${{ github.ref_name }}
- name: prep discord notification json
run: |
jq --arg ref "$GITHUB_REF_NAME" '.username = "Entity Texture Features \($ref) released!"' discord_update.json > tmp.json
mv tmp.json discord_update.json
- name: extract changelog segment
id: extract
run: |
VER="${GITHUB_REF_NAME#v}"
awk -v ver="$VER" '
$0=="[" ver "]" {p=1; next}
/^\[/ && p==1 {p=0}
p==1
' CHANGELOG.MD | sed '/./,$!d' | tac | sed '/./,$!d' | tac > CHANGELOG_SEGMENT.txt
- name: insert extracted text into json
run: |
jq --rawfile seg CHANGELOG_SEGMENT.txt '
.embeds[0].description = $seg
' discord_update.json > tmp.json
mv tmp.json discord_update.json
- name: print discord notification json to be verified before final upload (build will take a while)
run: cat discord_update.json
# Build the EGT fork
- name: build forked EGT plugin
run: ./forked-plugin/gradlew publishToMavenLocal
# Build the mod
- run: ./gradlew build
# todo
# - name: upload mod
# run: node uploader.js
# env:
# CF_TOKEN: ${{ secrets.CF_TOKEN }}
# CF_COOKIE: ${{ secrets.CF_COOKIE }}
# MODRINTH: ${{ secrets.MODRINTH }}
#
# - name: discord notification
# run: |
# curl -H "Content-Type: application/json" \
# -X POST \
# -d @discord_update.json \
# "$DISCORD_WEBHOOK"
# env:
# DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}