Skip to content

Commit

Permalink
build uatomation, fix crop tags
Browse files Browse the repository at this point in the history
  • Loading branch information
eerussianguy committed May 18, 2024
1 parent b05b864 commit 23c173b
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 78 deletions.
137 changes: 63 additions & 74 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build 1.18.x
name: Build 1.20.x

on:
push:
Expand All @@ -9,78 +9,67 @@ jobs:
main:

runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Get Version
id: version
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
let ref = '${{ github.ref }}';
return ref.startsWith('refs/tags/v') ? ref.replace('refs/tags/v', '') : 'indev';
- name: Get Version Type
id: version_type
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
let version = '${{ steps.version.outputs.result }}';
return version.includes('alpha') ? 'alpha' : (version.includes('beta') ? 'beta' : (version == 'indev' ? 'indev' : 'release'));
- name: Log Version Info
env:
VERSION: ${{ steps.version.outputs.result }}
VERSION_TYPE: ${{ steps.version_type.outputs.result }}
run: echo "version = $VERSION, type = $VERSION_TYPE"
- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: build
env:
VERSION: ${{ steps.version.outputs.result }}
- name: Create Release
id: create_release
if: ${{ steps.version.outputs.result != 'indev' && success() }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.version.outputs.result }}
release_name: Beneath v${{ steps.version.outputs.result }}
body: |
Version ${{ steps.version.outputs.result }}
### Changes
- todo: document changes
draft: true
prerelease: ${{ steps.version_type.outputs.result != 'release' }}
- name: Upload Main Jar
id: upload_main_jar
if: ${{ steps.version.outputs.result != 'indev' && success() }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/libs/beneath-${{ steps.version.outputs.result }}.jar
asset_name: beneath-${{ steps.version.outputs.result }}.jar
asset_content_type: application/java-archive
- name: Publish
id: publish
if: ${{ steps.version_type.outputs.result != 'alpha' && success() }}
uses: gradle/gradle-build-action@v2
with:
arguments: curseforge
env:
VERSION: ${{ steps.version.outputs.result }}
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Get Version
id: version
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
let ref = '${{ github.ref }}';
return ref.startsWith('refs/tags/v') ? ref.replace('refs/tags/v', '') : 'indev';
- name: Get Version Type
id: version_type
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
let version = '${{ steps.version.outputs.result }}';
return version.includes('alpha') ? 'alpha' : (version.includes('beta') ? 'beta' : 'release');
- name: Log Version Info
env:
VERSION: ${{ steps.version.outputs.result }}
VERSION_TYPE: ${{ steps.version_type.outputs.result }}
run: echo "version = $VERSION, type = $VERSION_TYPE"
- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: build
env:
VERSION: ${{ steps.version.outputs.result }}
- name: Publish
id: publish
if: ${{ steps.version.outputs.result != 'alpha' && success() }}
uses: Kir-Antipov/[email protected]
with:
modrinth-id: 5bKeBHw2
modrinth-token: ${{ secrets.MODRINTH_API_KEY }}

curseforge-id: 453394
curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }}

github-tag: ${{ github.ref }}
github-draft: true
github-prerelease: false
github-token: ${{ secrets.GITHUB_TOKEN }}

name: Beneath 1.20.1-${{ steps.version.outputs.result }}
version: ${{ steps.version.outputs.result }}
version-type: ${{ steps.version_type.outputs.result }}
java: 17
loaders: |
forge
neoforge
changelog-file: CHANGELOG.md
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Test 1.18.x
name: Test 1.20.x

on:
push:
branches:
- main
- 1.20.x
pull_request:
branches: [ main ]
branches: [ 1.20.x ]

jobs:
main:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is the first build of Beneath for 1.20.1!
1 change: 1 addition & 0 deletions resources/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def generate(rm: ResourceManager):
'name': 'beneath:seeds/%s' % crop
})
rm.item_model('seeds/%s' % crop).with_tag('tfc:seeds').with_lang(lang('%s seeds', crop))
block.with_tag('tfc:crops').with_tag('tfc:mineable_with_scythe').with_tag('tfc:mineable_with_sharp_tool')

rm.blockstate('gleamflower').with_block_model(parent='block/cross', textures={'cross': 'beneath:block/plant/gleamflower'}).with_block_loot('beneath:gleamflower').with_lang(lang('gleamflower')).with_tag('tfc:plants')
rm.item_model('gleamflower', 'beneath:block/plant/gleamflower')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private static ExtendedProperties crop()

private static ExtendedProperties dead()
{
return ExtendedProperties.of().noCollission().randomTicks().strength(0.4F).sound(SoundType.CROP).flammable(60, 30);
return ExtendedProperties.of().noCollission().randomTicks().strength(0.4F).sound(SoundType.CROP);
}

}
11 changes: 11 additions & 0 deletions src/main/resources/data/tfc/tags/blocks/crops.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"__comment__": "This file was automatically created by mcresources",
"replace": false,
"values": [
"beneath:crop/crimson_roots",
"beneath:crop/ghost_pepper",
"beneath:crop/gleamflower",
"beneath:crop/nether_wart",
"beneath:crop/warped_roots"
]
}
11 changes: 11 additions & 0 deletions src/main/resources/data/tfc/tags/blocks/mineable_with_scythe.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"__comment__": "This file was automatically created by mcresources",
"replace": false,
"values": [
"beneath:crop/crimson_roots",
"beneath:crop/ghost_pepper",
"beneath:crop/gleamflower",
"beneath:crop/nether_wart",
"beneath:crop/warped_roots"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"beneath:wood/leaves/warped",
"beneath:wood/sapling/warped",
"beneath:wood/fallen_leaves/warped",
"beneath:crop/crimson_roots",
"beneath:crop/ghost_pepper",
"beneath:crop/gleamflower",
"beneath:crop/nether_wart",
"beneath:crop/warped_roots",
"beneath:warped_thatch",
"beneath:crimson_thatch"
]
Expand Down

0 comments on commit 23c173b

Please sign in to comment.