Skip to content

Commit

Permalink
Publish backend
Browse files Browse the repository at this point in the history
  • Loading branch information
shedaniel committed Jun 1, 2022
1 parent 9ea62c0 commit 0072ecf
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/backend-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Create Backend Release
on:
push:
branches:
- master
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build project
run: |
cd backend
./gradlew build
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: release_${{ github.run_number }}
release_name: Release #${{ github.run_number }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./backend/build/libs/linkie-web-backend.jar
asset_name: linkie-web-backend.jar
asset_content_type: application/java-archive
27 changes: 26 additions & 1 deletion backend/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.6.21"
id "org.jetbrains.kotlin.plugin.serialization" version "1.6.21"
id "com.github.johnrengelman.shadow" version "7.0.0"
}

group = "me.shedaniel"
Expand All @@ -20,8 +21,14 @@ repositories {
maven { url "https://maven.quiltmc.org/repository/release" }
}

configurations {
shadow {
extendsFrom(implementation)
}
}

dependencies {
implementation("me.shedaniel:linkie-core:1.0.96")
implementation("me.shedaniel:linkie-core:1.0.101")
implementation("io.ktor:ktor-server-cors:2.0.1")
implementation("io.ktor:ktor-server-content-negotiation:2.0.1")
implementation("io.ktor:ktor-server-status-pages:2.0.1")
Expand All @@ -34,6 +41,24 @@ dependencies {
implementation 'io.ktor:ktor-client-core-jvm:2.0.2'
}

jar {
classifier "raw"
}

shadowJar {
configurations = [project.configurations.shadow]
classifier null
version null
mergeServiceFiles()
manifest {
attributes(
"Main-Class": "me.shedaniel.linkie.web.LinkieWebServerKt"
)
}
}

build.finalizedBy shadowJar

compileKotlin {
kotlinOptions.jvmTarget = '1.8'
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import me.shedaniel.linkie.getMappedDesc
import me.shedaniel.linkie.getObfMergedDesc
import me.shedaniel.linkie.obfMergedName
import me.shedaniel.linkie.utils.MemberEntry
import me.shedaniel.linkie.utils.ResultHolder
import me.shedaniel.linkie.utils.toVersion
import me.shedaniel.linkie.utils.tryToVersion
import me.shedaniel.linkie.web.deps.Deps
Expand Down

0 comments on commit 0072ecf

Please sign in to comment.