Skip to content

Commit 88e6a97

Browse files
committed
Overhaul, hopefully dual target CF and Artifact builds
1 parent 3899bbd commit 88e6a97

File tree

1 file changed

+36
-58
lines changed

1 file changed

+36
-58
lines changed

.github/workflows/test-build.yml

Lines changed: 36 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
# This workflow will build a Java project with Gradle
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3-
41
name: Test Build and Changelog
52

63
on:
74
workflow_dispatch:
85

96
jobs:
10-
generate:
7+
changelog:
118
name: Generate Changelog (tags)
129
runs-on: ubuntu-latest
1310
steps:
@@ -56,76 +53,57 @@ jobs:
5653
name: out
5754
path: .github/CHANGELOG.md
5855

59-
build:
60-
name: Gradle Build
61-
runs-on: ubuntu-latest
62-
63-
steps:
64-
- name: Checkout
65-
uses: actions/checkout@v2
66-
67-
- name: Set up JDK 1.8
68-
uses: actions/setup-java@v1
69-
with:
70-
java-version: 1.8
71-
72-
- name: Cache Gradle packages
73-
uses: actions/cache@v2
74-
with:
75-
path: ~/.gradle/caches
76-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
77-
restore-keys: ${{ runner.os }}-gradle
78-
79-
- name: Grant execute permission for gradlew
80-
run: chmod +x gradlew
81-
82-
- name: Build with Gradle
83-
run: ./gradlew jar
84-
env:
85-
CF_TOKEN: ${{ secrets.CF_API_TOKEN }}
86-
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
87-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88-
89-
- name: Add Artifact
90-
uses: actions/upload-artifact@v2
91-
with:
92-
name: libs
93-
path: build/libs/*.jar
94-
95-
view:
96-
name: View Changelog Output
56+
curseforge:
57+
name: Upload to CurseForge
9758
runs-on: ubuntu-latest
98-
needs: [generate]
59+
needs: [changelog]
9960
steps:
100-
- name: Download Build Results
61+
- name: Download Changelog Results
10162
uses: actions/download-artifact@v2
10263
with:
10364
name: out
10465
path: changelog
10566

106-
- run: cat changelog/CHANGELOG.md
107-
108-
upload:
109-
name: Upload to CurseForge
110-
runs-on: ubuntu-latest
111-
needs: [generate, build]
112-
env:
113-
CF_TOKEN: ${{ secrets.CF_API_TOKEN }}
114-
115-
steps:
11667
- name: Checkout
11768
uses: actions/checkout@v2
11869

11970
- name: Set up JDK 1.8
12071
uses: actions/setup-java@v1
12172
with:
12273
java-version: 1.8
123-
74+
75+
- name: Cache Gradle packages
76+
uses: actions/cache@v2
77+
with:
78+
path: ~/.gradle/caches
79+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
80+
restore-keys: ${{ runner.os }}-gradle
81+
82+
- name: Grant execute permission for gradlew
83+
run: chmod +x gradlew
84+
85+
- name: Build JAR
86+
run: /gradlew jar
87+
88+
- name: Do Upload
89+
run: ./gradlew curseforge
90+
env:
91+
CF_TOKEN: ${{ secrets.CF_API_TOKEN }}
92+
93+
- name: Add Artifact
94+
uses: actions/upload-artifact@v2
95+
with:
96+
name: result
97+
path: .
98+
99+
view:
100+
name: View Changelog Output
101+
runs-on: ubuntu-latest
102+
needs: [changelog]
103+
steps:
124104
- name: Download Build Results
125105
uses: actions/download-artifact@v2
126106
with:
127107
name: out
128108
path: changelog
129-
130-
- name: Do Upload
131-
run: ./gradlew curseforge
109+
- run: cat changelog/CHANGELOG.md

0 commit comments

Comments
 (0)