Skip to content

Commit

Permalink
chore: update workflow (#712)
Browse files Browse the repository at this point in the history
## Additions:
* Added missing messages to the `messages.yml`
  * Ability to customize the output of /crazycrates list
* Support for PlaceholderAPI in lores/displaynames for keys
* You no longer have to include `https://textures.minecraft.net/texture/` when using custom heads.
  * You can simply use `1ee3126ff2c343da525eef2b93272b9fed36273d0ea08c2616b80009948ad57e` in the `Player` field.
  * You can find an example in the `examples/crates` directory!
* Added a warning if trying to add AIR to a crate using `/crates additem`

## Breaking Changes:
### Permissions:
* Command / General Permissions have been updated!
  * You can find a list of permissions @ https://docs.crazycrew.us/docs/1.20.6/plugins/crazycrates/commands/permissions
  * They will not change again, but they are easier to type.

### In-game editor:
* All previous iterations of the in-game editor **do not** work anymore. All added prizes using the old methods WILL not work.
  * You **must** update all your prizes as a lot of the internals have changed for **1.20.5-1.20.6**

### Item IDS
* All items ids used for potions, materials, blocks, trim materials/patterns and sounds etc. have all been changed.
  * A list of sounds: https://minecraft.wiki/w/Sounds.json#Java_Edition_values, **Custom Sounds from resource packs are also supported!**
* Enchantments instead of `PROTECTION_ENVIRONMENTAL` and `DAMAGE_ALL`, It would be `protection` and `sharpness`
  * <details>
    <summary>List of Enchantments</summary>

    * protection
    * fire_protection
    * feather_falling
    * blast_protection
    * projectile_protection
    * respiration
    * aqua_affinity
    * thorns
    * depth_strider
    * frost_walker
    * binding_curse
    * sharpness
    * smite
    * bane_of_arthropods
    * knockback
    * fire_aspect
    * looting
    * sweeping_edge
    * efficiency
    * silk_touch
    * unbreaking
    * fortune
    * power
    * punch
    * flame
    * infinity
    * luck_of_the_sea
    * lure
    * loyalty
    * impaling
    * riptide
    * channeling
    * multishot
    * quick_charge
    * piercing
    * mending
    * vanishing_curse
    * soul_speed
    * swift_sneak
  </details>

* You can find a list of updated trim materials/patterns below!
  * https://docs.crazycrew.us/docs/1.20.6/plugins/crazycrates/guides/prizes/items/armor-trim

## Other:
* [Feature Requests](https://github.com/Crazy-Crew/CrazyCrates/discussions/categories/features)
* [Bug Reports](https://github.com/Crazy-Crew/CrazyCrates/issues)
  • Loading branch information
ryderbelserion authored May 16, 2024
1 parent 8e19c5c commit 07e951f
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 142 deletions.
96 changes: 94 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Publish Release
env:
NEXT_BUILD_NUMBER: ${{ vars.NEXT_BUILD_NUMBER }}
BUILD_INITIAL_VALUE: 1
on:
push:
branches:
Expand All @@ -18,6 +21,41 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

# https://github.com/granny/Pl3xMap/blob/1df593e5706444de28fc61855df5a7552afcd3c7/.github/workflows/build.yml#L26
- uses: actions/github-script@v6
name: Prepare build number if it doesn't exist
with:
debug: true
github-token: ${{ secrets.GH_TOKEN }}
script: |
const { owner, repo } = context.repo;
if (process.env.NEXT_BUILD_NUMBER === undefined || process.env.NEXT_BUILD_NUMBER === "") {
core.info(`Could not find a NEXT_BUILD_NUMBER env variable. Creating a new one with value ${process.env.BUILD_INITIAL_VALUE}.`);
const { status, data } = await github.request('POST /repos/{owner}/{repo}/actions/variables', {
owner: owner,
repo: repo,
name: "NEXT_BUILD_NUMBER",
value: process.env.BUILD_INITIAL_VALUE,
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
}).catch(err => err.response);
//const { status, data } = await github.rest.actions.createRepoVariable(owner, repo, "NEXT_BUILD_NUMBER", process.env.BUILD_INITIAL_VALUE);
core.debug(JSON.stringify(data, null, 2));
if (data?.message != undefined) {
return core.setFailed(`Failed to update configuration variable NEXT_BUILD_NUMBER with new value of '${process.env.BUILD_INITIAL_VALUE}' for reason ${data.message}`);
}
return core.exportVariable("NEXT_BUILD_NUMBER", process.env.BUILD_INITIAL_VALUE);
} else if (process.env.NEXT_BUILD_NUMBER.split('.').length > 1 || Number.isNaN(Number.parseInt(process.env.NEXT_BUILD_NUMBER))) {
return core.setFailed(`NEXT_BUILD_NUMBER variable has invalid value "${process.env.NEXT_BUILD_NUMBER}", failing build.`);
}
return core.exportVariable("NEXT_BUILD_NUMBER", process.env.NEXT_BUILD_NUMBER);
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

Expand All @@ -44,5 +82,59 @@ jobs:
env:
HANGAR_KEY: ${{ secrets.HANGAR_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
COMMIT_MESSAGE: ${{ join(github.event.commits.*.message, '<br>* ') }}
run: ./gradlew modrinth publishAllPublicationsToHangar --stacktrace
run: ./gradlew modrinth publishAllPublicationsToHangar --stacktrace

- name: Build Succeeded
uses: sarisia/actions-status-discord@v1
if: success()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
noprefix: true
nodetail: true
title: A new version of CrazyCrates is ready.
color: 0xE91E63
description: |
* <:hangar:1139326635313733652> https://hangar.papermc.io/CrazyCrew/CrazyCrates/versions/2.1-${{env.NEXT_BUILD_NUMBER}}
* <:modrinth:1115307870473420800> https://modrinth.com/plugin/crazycrates/version/2.1-${{env.NEXT_BUILD_NUMBER}}
- name: Build Failed
uses: sarisia/actions-status-discord@v1
if: ${{ failure() }}
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
noprefix: true
nodetail: true
title: The build didn't survive.
color: 0xff0000
description: |
Version 2.1 build ${{env.NEXT_BUILD_NUMBER}} has died.
Click [here](${{github.server_url}}/${{github.repository}}/actions/runs/${{ github.run_id }}) to view the run.
# https://github.com/granny/Pl3xMap/blob/1df593e5706444de28fc61855df5a7552afcd3c7/.github/workflows/build.yml#L95
- uses: actions/github-script@v6
name: Increment Build Number
if: success()
with:
debug: true
github-token: ${{ secrets.GH_TOKEN }}
script: |
const { owner, repo } = context.repo;
const value = '' + (${{ env.NEXT_BUILD_NUMBER }} + 1);
core.info(`attempting to update variable 'NEXT_BUILD_NUMBER' to '${value}'.`);
const { status, data } = await github.request('PATCH /repos/{owner}/{repo}/actions/variables/{name}', {
owner: owner,
repo: repo,
name: "NEXT_BUILD_NUMBER",
value: value,
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
}).catch(err => err.response);
//const { data } = await github.rest.actions.updateRepoVariable(owner, repo, "NEXT_BUILD_NUMBER", value)
core.debug(JSON.stringify(data, null, 2));
if (data?.message != undefined) {
return core.setFailed(`Failed to update configuration variable NEXT_BUILD_NUMBER with new value of '${value}'`);
}
140 changes: 0 additions & 140 deletions .github/workflows/snapshot.yml

This file was deleted.

0 comments on commit 07e951f

Please sign in to comment.