Skip to content

Commit 620837e

Browse files
authored
Merge pull request #37 from AMeierDev/develop
dev to main
2 parents 441e162 + 3ecc03f commit 620837e

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

.github/workflows/build_java.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2424
- uses: actions/checkout@v4
2525

26-
- name: Set up JDK 17
26+
- name: Set up JDK 21
2727
uses: actions/setup-java@v3
2828
with:
29-
java-version: '17'
30-
distribution: 'adopt'
29+
java-version: '21'
30+
distribution: 'temurin'
3131
- name: Build with Maven
3232
run: mvn clean package

.github/workflows/build_java_docker.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
branches:
1010
- main
1111
- staging
12+
- develop
1213

1314

1415
# Allows you to run this workflow manually from the Actions tab
@@ -26,15 +27,15 @@ jobs:
2627
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2728
- uses: actions/checkout@v4
2829

29-
- name: Set up JDK 17
30+
- name: Set up JDK 21
3031
uses: actions/setup-java@v3
3132
with:
32-
java-version: '17'
33-
distribution: 'adopt'
33+
java-version: '21'
34+
distribution: 'temurin'
3435
- name: Build with Maven
3536
run: mvn clean package
3637

37-
- uses: actions/upload-artifact@v3
38+
- uses: actions/upload-artifact@v4
3839
with:
3940
name: java.telegrambots.jar
4041
path: target/
@@ -54,7 +55,7 @@ jobs:
5455

5556
- uses: actions/checkout@v4
5657

57-
- uses: actions/download-artifact@v3
58+
- uses: actions/download-artifact@v4.1.7
5859
with:
5960
name: java.telegrambots.jar
6061
path: target/
@@ -105,4 +106,4 @@ jobs:
105106
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
106107
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
107108
- name: start docker with ssh
108-
run: ssh -i ~/private.key -p 19999 bigmama@bigamgamen.de 'docker remove -f bot-${{ env.GIT_BRANCH_NAME }} && docker image pull amgamen/chatbot:${{ env.GIT_BRANCH_NAME }} && docker run -d -v chatbotvol-${{ env.GIT_BRANCH_NAME }}:/opt/telegrambot/data --env-file ~/chatbot/env_${{ env.GIT_BRANCH_NAME }} --restart unless-stopped --name bot-${{ env.GIT_BRANCH_NAME }} amgamen/chatbot:${{ env.GIT_BRANCH_NAME }}'
109+
run: ssh -i ~/private.key -p 19999 bigmama@bigamgamen.de 'docker rm -f bot-${{ env.GIT_BRANCH_NAME }} && docker image pull amgamen/chatbot:${{ env.GIT_BRANCH_NAME }} && docker run -d -v chatbotvol-${{ env.GIT_BRANCH_NAME }}:/opt/telegrambot/data --env-file ~/chatbot/env_${{ env.GIT_BRANCH_NAME }} --restart unless-stopped --name bot-${{ env.GIT_BRANCH_NAME }} amgamen/chatbot:${{ env.GIT_BRANCH_NAME }}'

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<maven.compiler.source>17</maven.compiler.source>
14-
<maven.compiler.target>17</maven.compiler.target>
13+
<maven.compiler.source>21</maven.compiler.source>
14+
<maven.compiler.target>21</maven.compiler.target>
1515
<telegram.bot.version>6.4.0</telegram.bot.version>
16-
<eclipse.store.version>1.3.1</eclipse.store.version>
16+
<eclipse.store.version>2.1.3</eclipse.store.version>
1717
<microstream.version>08.01.01-MS-GA</microstream.version>
1818
</properties>
1919

@@ -48,7 +48,7 @@
4848
<dependency>
4949
<groupId>org.apache.commons</groupId>
5050
<artifactId>commons-lang3</artifactId>
51-
<version>3.14.0</version>
51+
<version>3.18.0</version>
5252
</dependency>
5353
<dependency>
5454
<groupId>org.mockito</groupId>
@@ -119,4 +119,4 @@
119119
</build>
120120

121121

122-
</project>
122+
</project>

src/main/java/de/bigamgamen/java/telegrambots/hertlhendl/HertlHendlBot.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ public class HertlHendlBot extends AbilityBot
115115
private final PaypalLinkGenerator payPalGenerator = new PaypalLinkGenerator();
116116

117117

118-
public static void main(final String[] args)
118+
public static void main( String[] args)
119119
throws ParserConfigurationException, SAXException, IOException, URISyntaxException, TelegramApiException
120120
{
121121
LOG.info("HertlHendlBot starting");
122122

123-
final String token = args[0] != null ? args[0] : BOT_TOKEN;
124-
final String username = args[1] != null ? args[1] : BOT_USERNAME;
125-
final Long creatorId = args[2] != null ? Long.valueOf(args[2]) : CREATOR_ID;
126-
final String creatorPayPalEmail = args[3] != null ? args[3] : "";
123+
final String token = args.length >= 1 && args[0] != null ? args[0] : BOT_TOKEN;
124+
final String username = args.length >= 2 && args[1] != null ? args[1] : BOT_USERNAME;
125+
final Long creatorId = args.length >= 3 && args[2] != null ? Long.valueOf(args[2]) : CREATOR_ID;
126+
final String creatorPayPalEmail = args.length >= 4 && args[3] != null ? args[3] : "";
127127
final HertlHendlBot bot = new HertlHendlBot(token, username, creatorId, creatorPayPalEmail);
128128
final TelegramBotsApi api = new TelegramBotsApi(DefaultBotSession.class);
129129
api.registerBot(bot);

0 commit comments

Comments
 (0)