Skip to content

Commit d66640e

Browse files
committed
little fix
1 parent 6f4b461 commit d66640e

4 files changed

Lines changed: 31 additions & 53 deletions

File tree

.github/workflows/release.yml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
name: Build release
22

3-
on:
3+
on:
44
push:
55
tags:
6-
- '*'
7-
release:
8-
types: [ published ]
6+
- '*'
97
workflow_dispatch:
108

119
jobs:
@@ -14,47 +12,60 @@ jobs:
1412
permissions:
1513
contents: write
1614
steps:
17-
15+
1816
- uses: actions/checkout@v5
19-
17+
with:
18+
fetch-depth: 0
19+
2020
- name: Setup up JDK 21
2121
uses: actions/setup-java@v5
2222
with:
2323
java-version: '21'
2424
distribution: 'temurin'
25-
25+
2626
- name: Setup Gradle
2727
uses: gradle/actions/setup-gradle@v5
2828
with:
29-
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
30-
29+
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
30+
3131
- name: Read version from gradle.properties
3232
id: gradle_props
3333
run: |
3434
VERSION=$(grep "^version" gradle.properties | cut -d'=' -f2 | tr -d '[:space:]')
3535
echo "version=$VERSION" >> $GITHUB_OUTPUT
3636
echo "Version: $VERSION"
37-
37+
38+
- name: Create tag if not exists
39+
run: |
40+
VERSION=${{ steps.gradle_props.outputs.version }}
41+
42+
if git rev-parse "$VERSION" >/dev/null 2>&1; then
43+
echo "Tag already exists"
44+
else
45+
git config user.name "github-actions"
46+
git config user.email "github-actions@github.com"
47+
git tag $VERSION
48+
git push origin $VERSION -o ci.skip
49+
fi
50+
3851
- name: Build with Gradle
3952
run: ./gradlew build
40-
53+
4154
- name: Upload JAR as artifact
4255
uses: actions/upload-artifact@v4
4356
with:
4457
name: SAPI-${{ steps.gradle_props.outputs.version }}
45-
path: build/libs/SAPI*.jar
46-
58+
path: build/libs/*.jar
59+
4760
- name: Create or Update Release
48-
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
4961
uses: softprops/action-gh-release@v2
5062
with:
51-
name: Release ${{ steps.gradle_props.outputs.version }}
52-
tag_name: ${{ github.ref_name }}
63+
name: ${{ steps.gradle_props.outputs.version }}
5364
files: build/libs/*.jar
65+
tag_name: ${{ steps.gradle_props.outputs.version }}
5466
generate_release_notes: true
5567
fail_on_unmatched_files: false
5668
draft: false
57-
prerelease: ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') }}
69+
prerelease: ${{ contains(steps.gradle_props.outputs.version, 'beta') || contains(steps.gradle_props.outputs.version, 'alpha') || contains(steps.gradle_props.outputs.version, 'SNAPSHOT') }}
5870
env:
5971
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60-

.github/workflows/tag.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
folia_version=1.21.11-R0.1-SNAPSHOT
2-
version=1.1.4
2+
version=1.1.5

src/main/java/com/unfamoussoul/sapi/module/SAPIModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public abstract class SAPIModule {
1717
protected SAPI plugin;
1818
protected final List<DynamicCommand> registeredCommands = new ArrayList<>();
1919

20-
protected SAPIModule(SAPI plugin) {
20+
public SAPIModule(SAPI plugin) {
2121
this.plugin = plugin;
2222
}
2323

0 commit comments

Comments
 (0)