Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #17 from TurnipTales/develop
Browse files Browse the repository at this point in the history
develop
  • Loading branch information
rettichlp authored Jul 16, 2024
2 parents ee1efde + 4416321 commit 395c982
Show file tree
Hide file tree
Showing 42 changed files with 1,867 additions and 1,060 deletions.
35 changes: 26 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
name: Build

on:
push:
branches: [ "develop", "hotfix/**" ]
pull_request:
branches:
- main
- develop
branches: [ "develop", "hotfix/**" ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:

name: 🏗️ Build TurnipTales Discord Bot
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
- uses: actions/checkout@v4
with:
distribution: 'corretto'
java-version: '17'
fetch-depth: 0

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Set application properties
env:
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
run: |
echo "discord.bot.token=$DISCORD_BOT_TOKEN" >> src/main/resources/application.properties
- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn -B test package --file pom.xml
57 changes: 45 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,57 @@ name: Release

on:
push:
branches:
- main
branches: [ "main" ]

jobs:
release:

name: 🎉 Release TurnipTales Discord Bot
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
- uses: actions/checkout@v4
with:
distribution: 'corretto'
java-version: '17'
fetch-depth: 0

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Set application properties
env:
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
run: |
echo "discord.bot.token=$DISCORD_BOT_TOKEN" >> src/main/resources/application.properties
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Upload Artifact
uses: actions/upload-artifact@v3
run: mvn -B test package --file pom.xml

- if: github.event_name == 'push'
name: Upload via SCP
uses: appleboy/[email protected]
with:
host: turniptales.net
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: 22
source: "target/turniptales-discord.jar"
target: "/home/discord"
timeout: 120s
strip_components: 1

- if: github.event_name == 'push'
name: Restart TurnipTales API
uses: appleboy/[email protected]
with:
name: Artifacts
path: target/discord-1.0.0.jar
host: turniptales.net
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: 22
script: |
cd /home/discord
chown -R root:root turniptales-discord.jar
./run.sh
21 changes: 19 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip
7 changes: 0 additions & 7 deletions Dockerfile

This file was deleted.

Loading

0 comments on commit 395c982

Please sign in to comment.