improve ci
This commit is contained in:
92
.gitea/workflows/ci.yaml
Normal file
92
.gitea/workflows/ci.yaml
Normal file
@@ -0,0 +1,92 @@
|
||||
on:
|
||||
push:
|
||||
branches: [ develop, main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: linux
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Cache Gradle
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: gradle-${{ hashFiles('**/libs.versions.toml') }}
|
||||
restore-keys: gradle-
|
||||
path: |
|
||||
~/.gradle/caches/
|
||||
~/.gradle/wrapper/
|
||||
|
||||
- name: Cache Konan
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: konan-${{ hashFiles('**/libs.versions.toml') }}
|
||||
restore-keys: konan-
|
||||
path: |
|
||||
~/.konan/
|
||||
|
||||
- name: Cache Node
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: node-${{ hashFiles('**/libs.versions.toml') }}
|
||||
restore-keys: node-
|
||||
path: |
|
||||
~/.gradle/nodejs
|
||||
~/.gradle/yarn
|
||||
|
||||
- name: Test
|
||||
run: ./gradlew allTests
|
||||
|
||||
publish:
|
||||
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
|
||||
needs: test
|
||||
runs-on: linux
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Cache Gradle
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: gradle-${{ hashFiles('**/libs.versions.toml') }}
|
||||
restore-keys: gradle-
|
||||
path: |
|
||||
~/.gradle/caches/
|
||||
~/.gradle/wrapper/
|
||||
|
||||
- name: Cache Konan
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: konan-${{ hashFiles('**/libs.versions.toml') }}
|
||||
restore-keys: konan-
|
||||
path: |
|
||||
~/.konan/
|
||||
|
||||
- name: Cache Node
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: node-${{ hashFiles('**/libs.versions.toml') }}
|
||||
restore-keys: node-
|
||||
path: |
|
||||
~/.gradle/nodejs
|
||||
~/.gradle/yarn
|
||||
|
||||
- name: Publish
|
||||
run: ./gradlew publish
|
||||
env:
|
||||
INFENDRO__TOKEN: ${{ secrets.TOKEN }}
|
||||
@@ -1,36 +0,0 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
env:
|
||||
INFENDRO__TOKEN: ${{ secrets.TOKEN }}
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: linux
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/cache/restore@v4
|
||||
with:
|
||||
key: gradle
|
||||
path: |
|
||||
~/.gradle/caches/
|
||||
~/.gradle/wrapper/
|
||||
~/.konan/
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'temurin'
|
||||
|
||||
- run: ./gradlew publish
|
||||
|
||||
- uses: actions/cache/save@v4
|
||||
with:
|
||||
key: gradle
|
||||
path: |
|
||||
~/.gradle/caches/
|
||||
~/.gradle/wrapper/
|
||||
~/.konan/
|
||||
@@ -12,10 +12,10 @@ plugins {
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
linuxX64()
|
||||
js {
|
||||
nodejs()
|
||||
}
|
||||
linuxX64()
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
Reference in New Issue
Block a user