Skip to content

Merge pull request #162 from Lyzev/161-bug-true-sight-broken #100

Merge pull request #162 from Lyzev/161-bug-true-sight-broken

Merge pull request #162 from Lyzev/161-bug-true-sight-broken #100

name: "Release Nightly Build"
on:
workflow_dispatch:
push:
paths:
- '*.properties'
- '*.kts'
- 'gradle/**'
- "src/**"
branches:
- 'master'
jobs:
build:
runs-on: ubuntu-latest
env:
CI: true
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
cache: gradle
- name: Read version from gradle.properties
id: get_version
run: echo "mod_version=$(grep -oP 'mod_version=\K.+' gradle.properties)" >> $GITHUB_OUTPUT
- name: Read mod_name from gradle.properties
id: get_mod_name
run: echo "mod_name=$(grep -oP 'mod_name=\K.+' gradle.properties)" >> $GITHUB_OUTPUT
- name: Read minecraft version from libs.versions.toml
id: get_minecraft_version
run: echo "minecraft_version=$(grep -oP 'minecraft = "\K[^"]+' gradle/libs.versions.toml)" >> $GITHUB_OUTPUT
- name: Set Commit Hash
id: commit_hash
run: echo "commit_hash=$(git log --pretty=format:'%h' -n 1)" >> $GITHUB_OUTPUT
- name: Build the project
run: ./gradlew build
- name: Create Release Assets
run: |
echo "Running shell script with version: ${{ github.event.inputs.version }}"
mkdir release
for file in build/libs/*.jar; do
if [[ $file != *"-shadow.jar" ]]; then
cp $file release
fi
done
for asset in release/*; do
md5sum $asset >> $asset.md5
sha1sum $asset >> $asset.sha1
sha256sum $asset >> $asset.sha256
sha512sum $asset >> $asset.sha512
done
ls -l release
- uses: marvinpinto/action-automatic-releases@latest
name: Create Release
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
automatic_release_tag: 'v${{ steps.get_version.outputs.mod_version }}-${{ steps.commit_hash.outputs.commit_hash }}+${{ steps.get_minecraft_version.outputs.minecraft_version }}'
title: '${{ steps.get_mod_name.outputs.mod_name }} ${{ steps.get_version.outputs.mod_version }}-${{ steps.commit_hash.outputs.commit_hash }}+${{ steps.get_minecraft_version.outputs.minecraft_version }}'
files: |
release/*