Skip to content

Commit

Permalink
[1.16] 1.6.1 release (#17)
Browse files Browse the repository at this point in the history
* make lua functions final

* cleanup and improve CI

* update changelog

* bump version
  • Loading branch information
rlnt committed Jan 16, 2022
1 parent 393ad00 commit e666e87
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 70 deletions.
84 changes: 29 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,28 @@ on:
- '1.16'

env:
JAVA_DIST: 'zulu'
JAVA_VERSION: 11
JAR_NAME: 'energymeter'
FILE_NAME: 'EnergyMeter'

jobs:
check:
name: Lint & Build
build:
name: Build & Analyze
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1.0.3

- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'zulu'

- name: Make gradlew executable
run: chmod +x ./gradlew
distribution: ${{ env.JAVA_DIST }}

- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Gradle packages
- name: Gradle Cache
uses: actions/cache@v2
with:
path: |
Expand All @@ -55,45 +43,39 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Analyze
- name: SonarCloud Cache
uses: actions/cache@v2
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Build and Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonarqube --info

- name: Build
run: ./gradlew build --no-daemon
run: |
chmod +x ./gradlew
./gradlew build sonarqube --stacktrace --no-daemon
- name: Checks
run: ./gradlew check --no-daemon

- name: Test
run: ./gradlew test --no-daemon

publish:
name: Publish
release:
name: Release
runs-on: ubuntu-latest
needs: check
needs: build
if: startsWith(github.ref, 'refs/tags/v1.16-')
steps:
- name: Clone Repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1.0.3

- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'zulu'
distribution: ${{ env.JAVA_DIST }}

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Cache Gradle packages
- name: Gradle Cache
uses: actions/cache@v2
with:
path: |
Expand All @@ -103,23 +85,15 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Build
run: ./gradlew build --no-daemon

- name: Checks
run: ./gradlew check --no-daemon

- name: Test
run: ./gradlew test --no-daemon

- name: Assemble
run: ./gradlew jar --no-daemon

- name: Find the jar
run: echo "JAR_FILE=$(find build/libs/${{ env.JAR_NAME }}-*-*.jar)" >> $GITHUB_ENV
- name: Assemble the jar
run: |
chmod +x ./gradlew
./gradlew jar --no-daemon
- name: Extract Minecraft and Mod Version
run: echo ${JAR_FILE%.*} | awk -F- '{ print "MINECRAFT_VERSION=" $2; print "MOD_VERSION=" $3; }' >> $GITHUB_ENV
- name: JAR manipulation
run: |
echo "JAR_FILE=$(find build/libs/${{ env.JAR_NAME }}-*-*.jar)" >> $GITHUB_ENV
echo ${JAR_FILE%.*} | awk -F- '{ print "MINECRAFT_VERSION=" $2; print "MOD_VERSION=" $3; }' >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v2
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ and this project adheres to [Semantic Versioning].
- /


## [1.6.1] - 2022-01-17

### Fixed
- CC: Tweaked integration spamming the log with warnings when connection the Energy Meter to a computer ([#17])

<!-- Links -->
[#17]: https://github.com/AlmostReliable/energymeter-forge/pull/17


## [1.6.0] - 2022-01-14

### Added
Expand Down Expand Up @@ -198,7 +207,8 @@ and this project adheres to [Semantic Versioning].
[semantic versioning]: https://semver.org/spec/v2.0.0.html

<!-- Versions -->
[unreleased]: https://github.com/AlmostReliable/energymeter-forge/compare/v1.16-1.6.0...HEAD
[unreleased]: https://github.com/AlmostReliable/energymeter-forge/compare/v1.16-1.6.1...HEAD
[1.6.1]: https://github.com/AlmostReliable/energymeter-forge/compare/v1.16-1.6.0..v1.16-1.6.1
[1.6.0]: https://github.com/AlmostReliable/energymeter-forge/compare/v1.16-1.5.0..v1.16-1.6.0
[1.5.0]: https://github.com/AlmostReliable/energymeter-forge/compare/v1.16-1.4.1..v1.16-1.5.0
[1.4.1]: https://github.com/AlmostReliable/energymeter-forge/compare/v1.16-1.4.0..v1.16-1.4.1
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mappings_version = 2021.10.17-1.16.5
# mod info
mod_id = energymeter
mod_name = Energy Meter
mod_version = 1.6.0
mod_version = 1.6.1
mod_base_package = com.github.almostreliable
mod_authors = AlmostReliable, Relentless
mod_description = Easily measure your energy rates.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import static com.github.almostreliable.energymeter.core.Constants.*;

@SuppressWarnings("unused")
@SuppressWarnings({"unused", "FinalMethod"})
public class MeterPeripheral implements IPeripheral, IMeterTileObserver {

private final MeterTile tile;
Expand All @@ -26,22 +26,22 @@ public class MeterPeripheral implements IPeripheral, IMeterTileObserver {
}

@LuaFunction(mainThread = true)
public MethodResult getSideConfig(Direction direction) {
public final MethodResult getSideConfig(Direction direction) {
return MethodResult.of(tile.getSideConfig().get(direction).name());
}

@LuaFunction(mainThread = true)
public MethodResult hasInput() {
public final MethodResult hasInput() {
return MethodResult.of(tile.getSideConfig().hasInput());
}

@LuaFunction(mainThread = true)
public MethodResult hasOutput() {
public final MethodResult hasOutput() {
return MethodResult.of(tile.getSideConfig().hasOutput());
}

@LuaFunction(mainThread = true)
public MethodResult hasMaxOutputs() {
public final MethodResult hasMaxOutputs() {
return MethodResult.of(tile.getSideConfig().hasMaxOutputs());
}

Expand Down Expand Up @@ -90,42 +90,42 @@ public boolean equals(@Nullable IPeripheral other) {
}

@LuaFunction(mainThread = true)
public MethodResult getInterval() {
public final MethodResult getInterval() {
return MethodResult.of(tile.getInterval());
}

@LuaFunction(mainThread = true)
public MethodResult getTransferRate() {
public final MethodResult getTransferRate() {
return MethodResult.of(tile.getTransferRate());
}

@LuaFunction(mainThread = true)
public MethodResult getThreshold() {
public final MethodResult getThreshold() {
return MethodResult.of(tile.getThreshold());
}

@LuaFunction(mainThread = true)
public MethodResult getNumberMode() {
public final MethodResult getNumberMode() {
return MethodResult.of(tile.getNumberMode().name());
}

@LuaFunction(mainThread = true)
public MethodResult getMode() {
public final MethodResult getMode() {
return MethodResult.of(tile.getMode().name());
}

@LuaFunction(mainThread = true)
public MethodResult getAccuracy() {
public final MethodResult getAccuracy() {
return MethodResult.of(tile.getAccuracy().name());
}

@LuaFunction(mainThread = true)
public MethodResult getStatus() {
public final MethodResult getStatus() {
return MethodResult.of(tile.getStatus().name());
}

@LuaFunction(mainThread = true)
public MethodResult getFullSideConfig() {
public final MethodResult getFullSideConfig() {
return MethodResult.of(tile.getSideConfig().asStringMap());
}
}

0 comments on commit e666e87

Please sign in to comment.