Skip to content

Commit 292c7a1

Browse files
authored
Only publish to maven on main fork (#1345)
1 parent 230e737 commit 292c7a1

File tree

2 files changed

+6
-23
lines changed

2 files changed

+6
-23
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ jobs:
151151
- run: |
152152
chmod +x gradlew
153153
./gradlew photon-targeting:build photon-lib:build -Pbuildalldesktop -i
154-
- run: ./gradlew photon-lib:publish photon-targeting:publish
154+
- run: ./gradlew photon-lib:publish photon-targeting:publish -Pbuildalldesktop
155155
name: Publish
156156
env:
157157
ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }}
158-
if: github.event_name == 'push'
158+
if: github.event_name == 'push' && github.repository_owner == 'photonvision'
159159
# Copy artifacts to build/outputs/maven
160-
- run: ./gradlew photon-lib:publish photon-targeting:publish outputVersion -PcopyOfflineArtifacts
160+
- run: ./gradlew photon-lib:publish photon-targeting:publish -PcopyOfflineArtifacts -Pbuildalldesktop
161161
- uses: actions/upload-artifact@v4
162162
with:
163163
name: maven-${{ matrix.artifact-name }}
@@ -196,12 +196,12 @@ jobs:
196196
- name: Publish
197197
run: |
198198
chmod +x gradlew
199-
./gradlew photon-lib:publish photon-targeting:publish
199+
./gradlew photon-lib:publish photon-targeting:publish ${{ matrix.build-options }}
200200
env:
201201
ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }}
202-
if: github.event_name == 'push'
202+
if: github.event_name == 'push' && github.repository_owner == 'photonvision'
203203
# Copy artifacts to build/outputs/maven
204-
- run: ./gradlew photon-lib:publish photon-targeting:publish outputVersion -PcopyOfflineArtifacts
204+
- run: ./gradlew photon-lib:publish photon-targeting:publish -PcopyOfflineArtifacts ${{ matrix.build-options }}
205205
- uses: actions/upload-artifact@v4
206206
with:
207207
name: maven-${{ matrix.artifact-name }}

build.gradle

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,6 @@ ext {
6060
println("Publishing Photonlib to " + photonMavenURL)
6161
}
6262

63-
task outputVersion() {
64-
def versionFile = file("$allOutputsFolder/version.txt")
65-
66-
description = 'Prints the versions of wpilib to a file for use by the downstream packaging project'
67-
group = 'Build'
68-
outputs.files(versionFile)
69-
70-
doFirst {
71-
buildDir.mkdir()
72-
allOutputsFolder.mkdir()
73-
}
74-
75-
doLast {
76-
versionFile.write versionString
77-
}
78-
}
79-
8063
spotless {
8164
java {
8265
target fileTree('.') {

0 commit comments

Comments
 (0)