diff --git a/.forgejo/workflows/pipeline.yaml b/.forgejo/workflows/pipeline.yaml new file mode 100644 index 0000000..dd4e1a6 --- /dev/null +++ b/.forgejo/workflows/pipeline.yaml @@ -0,0 +1,24 @@ +on: + release: + types: [published] +jobs: + upload: + runs-on: host + permissions: + packages: write + steps: + - uses: actions/setup-node@v6 + with: + node-version: 24 + - uses: actions/checkout@v6 + - run: ./gradlew buildFatJar + - run: | + curl -X POST \ + -H "Authorization: token ${{ github.token }}" \ + -F "attachment=@build/libs/todo-all.jar" \ + "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets" + - run: | + export XDG_RUNTIME_DIR=/run/user/$(id -u) + export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus + cp build/libs/todo-all.jar ~/todo/app.jar + systemctl --user restart todo \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 2586bcf..e3ae9d0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,6 +29,15 @@ buildscript { } } +tasks { + shadowJar { + mergeServiceFiles { + include("META-INF/services/**") + duplicatesStrategy = DuplicatesStrategy.INCLUDE + } + } +} + dependencies { implementation("io.ktor:ktor-server-core") implementation("io.ktor:ktor-server-content-negotiation") diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 934ebd5..c915446 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -3,7 +3,7 @@ ktor: modules: - cz.flegr.ApplicationKt.module deployment: - port: 8080 + port: "$PORT:8080" postgres: url: "jdbc:postgresql://localhost:5432/todo" user: postgres