diff --git a/.gitea/workflows/gradle-build.yaml b/.gitea/workflows/gradle-build.yaml new file mode 100644 index 0000000..61945c8 --- /dev/null +++ b/.gitea/workflows/gradle-build.yaml @@ -0,0 +1,40 @@ +name: Build + +on: + push: + +jobs: + Gradle Build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '23' + check-latest: true + distribution: 'zulu' + + - name: Cache Gradle dependencies + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Build + run: chmod +x gradlew; ./gradlew assemble + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: artifacts + path: | + lib/build/libs/*.jar + wrapper/javacord/build/libs/*.jar diff --git a/.gitea/workflows/gradle-publish.yaml b/.gitea/workflows/gradle-publish.yaml new file mode 100644 index 0000000..dbbb9bc --- /dev/null +++ b/.gitea/workflows/gradle-publish.yaml @@ -0,0 +1,31 @@ +name: Test + +on: + push: + branches: [master] + +jobs: + Gradle Test: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '23' + check-latest: true + distribution: 'zulu' + + - name: Cache Gradle dependencies + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Publish + env: + GITEA_TOKEN: {{ secrets.PUBLISH_PACKAGE_TOKEN }} + run: chmod +x gradlew; ./gradlew publishAllPublicationsToGiteaRepository \ No newline at end of file diff --git a/.gitea/workflows/gradle-test.yaml b/.gitea/workflows/gradle-test.yaml new file mode 100644 index 0000000..8adeb5b --- /dev/null +++ b/.gitea/workflows/gradle-test.yaml @@ -0,0 +1,38 @@ +name: Test + +on: + push: + +jobs: + Gradle Test: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '23' + check-latest: true + distribution: 'zulu' + + - name: Cache Gradle dependencies + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Test + env: + DISCORD_TEST_TOKEN: {{ secrets.DISCORD_TOKEN }} + run: chmod +x gradlew; ./gradlew test + + - name: Publish Test Results + if: always() + uses: dorny/test-reporter@v1 + with: + name: Test Results + path: build/test-results/test/*.xml + reporter: junit \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..5f1ed7b --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +org.gradle.caching=true \ No newline at end of file