Skip to content

Commit f502f4e

Browse files
committed
fix: workflows fix
1 parent 5f4b246 commit f502f4e

2 files changed

Lines changed: 19 additions & 47 deletions

File tree

.github/workflows/main_optimo-user.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212

1313
jobs:
1414
build-and-deploy:
15-
runs-on: windows-latest
15+
runs-on: ubuntu-latest # Windows -> Linux로 변경
1616
permissions:
1717
id-token: write
1818
contents: read
@@ -25,28 +25,16 @@ jobs:
2525
uses: actions/setup-java@v4
2626
with:
2727
java-version: ${{ env.JAVA_VERSION }}
28-
distribution: 'microsoft'
28+
distribution: 'temurin' # Microsoft -> Temurin으로 변경
2929

30-
- name: Grant gradlew execute permission
31-
shell: pwsh
32-
run: |
33-
if (Test-Path "gradlew") {
34-
# icacls 대신 PowerShell 명령어 사용
35-
$file = Get-Item "gradlew"
36-
$file.Attributes = $file.Attributes -bor [System.IO.FileAttributes]::Normal
37-
}
30+
- name: Grant execute permission
31+
run: chmod +x gradlew # Linux에서 권한 설정
3832

3933
- name: Build with Gradle
40-
shell: pwsh
41-
run: |
42-
.\gradlew clean build --stacktrace --info
43-
ls -R build/libs # 빌드 결과 확인
34+
run: ./gradlew clean build --stacktrace --info
4435

4536
- name: Package Azure Functions
46-
shell: pwsh
47-
run: |
48-
./gradlew azureFunctionsScan --console=plain
49-
Get-Content build/azure-functions/${{ env.AZURE_FUNCTIONAPP_NAME }}/**/function.json
37+
run: ./gradlew azureFunctionsPackage --stacktrace
5038

5139
- name: Login to Azure
5240
uses: azure/login@v2
@@ -59,5 +47,4 @@ jobs:
5947
uses: Azure/functions-action@v1
6048
with:
6149
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
62-
package: build/azure-functions/${{ env.AZURE_FUNCTIONAPP_NAME }}
63-
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }}
50+
package: build/azure-functions/${{ env.AZURE_FUNCTIONAPP_NAME }}

build.gradle

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,14 @@ dependencyManagement {
2727
dependencies {
2828
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
2929
implementation 'org.springframework.boot:spring-boot-starter-web'
30-
implementation 'org.springframework.cloud:spring-cloud-starter-function-web' // ✅ Spring Cloud Function 웹 스타터
31-
// 🔥 Azure 라이브러리 버전 업그레이드
32-
implementation 'com.microsoft.azure.functions:azure-functions-java-library:2.0.1'
33-
// 🔥 Spring Cloud Function 버전 일치
30+
implementation 'org.springframework.cloud:spring-cloud-starter-function-web'
3431
implementation 'org.springframework.cloud:spring-cloud-function-adapter-azure:4.0.4'
32+
implementation 'com.microsoft.azure.functions:azure-functions-java-library:2.0.1'
3533

3634
developmentOnly 'org.springframework.boot:spring-boot-devtools'
3735
testImplementation 'org.springframework.boot:spring-boot-starter-test'
3836
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
3937

40-
implementation 'com.microsoft.azure.functions:azure-functions-java-library:1.4.2'
41-
4238
implementation 'org.postgresql:postgresql:42.6.0'
4339
runtimeOnly 'org.postgresql:postgresql'
4440

@@ -50,19 +46,23 @@ dependencies {
5046
annotationProcessor 'org.projectlombok:lombok:1.18.30'
5147

5248
implementation 'org.springframework.boot:spring-boot-starter-webflux'
49+
50+
// 🔥 Reflections 버전 고정
51+
implementation 'org.reflections:reflections:0.10.2'
5352
}
5453

54+
// JAR 설정 (단일 블록으로 통합)
5555
jar {
56-
archiveBaseName.set("Optimo_User_BE")
57-
archiveVersion.set("0.0.1-SNAPSHOT")
56+
archiveBaseName = "Optimo_User_BE"
57+
archiveVersion = "0.0.1-SNAPSHOT"
58+
archiveClassifier = '' // plain JAR 비활성화
5859
}
5960

6061
tasks.named("azureFunctionsPackage") {
6162
dependsOn("jar")
6263
ignoreFailures = false
6364
}
6465

65-
6666
tasks.named('test') {
6767
useJUnitPlatform()
6868
}
@@ -73,33 +73,18 @@ azurefunctions {
7373
appName = 'optimo-user'
7474
region = 'Korea Central'
7575
runtime {
76-
os = 'windows'
76+
os = 'linux' // Windows -> Linux로 변경
7777
javaVersion = '17'
7878
}
7979
appSettings {
8080
FUNCTIONS_EXTENSION_VERSION = '~4'
8181
FUNCTIONS_WORKER_RUNTIME = 'java'
8282
}
83-
84-
functions = [
85-
'org.inhahackers.optmo_user_be.function.UserFunction',
86-
'org.inhahackers.optmo_user_be.function.IncreaseElecFunction',
87-
'org.inhahackers.optmo_user_be.function.OAuthUserFunction',
88-
'org.inhahackers.optmo_user_be.function.JWTUserFunction'
89-
]
90-
}
91-
92-
// 2. JAR 생성 방식 단일화
93-
jar {
94-
archiveBaseName.set("Optimo_User_BE")
95-
archiveVersion.set("0.0.1-SNAPSHOT")
96-
// 🔥 plain JAR 비활성화
97-
archiveClassifier = ''
9883
}
9984

100-
// 3. Reflections 버전 고정 (문제 해결 핵심)
85+
// 🔥 함수 클래스 스캔 문제 해결을 위한 구성
10186
configurations.all {
10287
resolutionStrategy {
103-
force 'org.reflections:reflections:0.10.2' // 안정적인 버전
88+
force 'org.reflections:reflections:0.10.2'
10489
}
10590
}

0 commit comments

Comments
 (0)