Skip to content

Commit 567018f

Browse files
committed
Fixed workflows
1 parent 649f393 commit 567018f

File tree

3 files changed

+34
-25
lines changed

3 files changed

+34
-25
lines changed

.github/workflows/main-branch.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77

88
jobs:
9-
build-jar:
9+
build-jars:
1010
runs-on: ubuntu-latest
1111

1212
steps:
@@ -22,9 +22,6 @@ jobs:
2222
- name: Setup Gradle
2323
uses: gradle/actions/setup-gradle@v4
2424

25-
- name: Change wrapper permissions
26-
run: chmod +x ./gradlew
27-
2825
- name: Build with Gradle Wrapper
2926
run: ./gradlew build
3027

.github/workflows/release-branch.yml

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- release/*
77

88
jobs:
9-
build-jar:
9+
build-jars:
1010
runs-on: ubuntu-latest
1111

1212
steps:
@@ -22,9 +22,6 @@ jobs:
2222
- name: Setup Gradle
2323
uses: gradle/actions/setup-gradle@v4
2424

25-
- name: Change wrapper permissions
26-
run: chmod +x ./gradlew
27-
2825
- name: Build with Gradle Wrapper
2926
run: ./gradlew build
3027

@@ -43,7 +40,7 @@ jobs:
4340
- name: Upload jars
4441
uses: actions/upload-artifact@v4
4542
with:
46-
name: ${{ github.ref_name }}-jars
43+
name: ${{ env.PROJECT_NAME }}-${{ env.VERSION }}-jars
4744
path: build/libs/*.jar
4845

4946
build-and-push-docker:
@@ -87,7 +84,7 @@ jobs:
8784
with:
8885
context: .
8986
push: true
90-
tags: ${{ steps.meta.outputs.tags }}, "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
87+
tags: ${{ steps.meta.outputs.tags }}, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
9188
labels: ${{ steps.meta.outputs.labels }}
9289

9390
- name: Generate artifact attestation
@@ -130,43 +127,58 @@ jobs:
130127
run: |
131128
helm package ./helm --destination ./chart
132129
133-
- name: Read Helm Chart
134-
id: helm-chart-reader
135-
uses: jacobtomlinson/[email protected]
136-
with:
137-
path: ./chart/*
130+
- name: Extract project name from Gradle
131+
id: extract_name
132+
run: |
133+
PROJECT_NAME=$(./gradlew -q printProjectName)
134+
echo "PROJECT_NAME=${PROJECT_NAME}" >> $GITHUB_ENV
135+
136+
- name: Extract version from Gradle
137+
id: get-version
138+
run: |
139+
VERSION=$(./gradlew -q printProjectVersion)
140+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
138141
139142
- name: Upload Helm Chart
140143
uses: actions/upload-artifact@v4
141144
with:
142-
name: ${{ github.ref_name }}-helm-chart
145+
name: ${{ env.PROJECT_NAME }}-${{ env.VERSION }}-helm-chart
143146
path: build/libs/*.tgz
144147

145148
create-release:
146149
runs-on: ubuntu-latest
150+
needs:
151+
- build-jars
152+
- package-and-push-helm
147153

148154
steps:
149155
- name: Checkout repository
150156
uses: actions/checkout@v4
151157

158+
- name: Extract project name from Gradle
159+
id: extract_name
160+
run: |
161+
PROJECT_NAME=$(./gradlew -q printProjectName)
162+
echo "PROJECT_NAME=${PROJECT_NAME}" >> $GITHUB_ENV
163+
164+
- name: Extract version from Gradle
165+
id: get-version
166+
run: |
167+
VERSION=$(./gradlew -q printProjectVersion)
168+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
169+
152170
- name: Download jars
153171
uses: actions/download-artifact@v4
154172
with:
155-
name: ${{ github.ref_name }}-jars
173+
name: ${{ env.PROJECT_NAME }}-${{ env.VERSION }}-jars
156174
path: artifacts/
157175

158176
- name: Download Helm Chart
159177
uses: actions/download-artifact@v4
160178
with:
161-
name: ${{ github.ref_name }}-helm-chart
179+
name: ${{ env.PROJECT_NAME }}-${{ env.VERSION }}-helm-chart
162180
path: artifacts/
163181

164-
- name: Extract version from file
165-
id: get-version
166-
run: |
167-
VERSION=$(./gradlew -q printProjectVersion)
168-
echo "VERSION=${VERSION}" >> $GITHUB_ENV
169-
170182
- name: Release
171183
uses: softprops/action-gh-release@v2
172184
if: true

helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: cp-programming-stats-bot
33
version: 1.0.0
4-
description: A Helm chart for deploying Competitive Programming Statistics Discord Bot
4+
description: A Helm chart for deploying Competitive Programming Statistics Bot
55

66
type: application

0 commit comments

Comments
 (0)