Skip to content

Commit

Permalink
Only publish to maven on main fork (#1345)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 authored Jun 11, 2024
1 parent 230e737 commit 292c7a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 23 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ jobs:
- run: |
chmod +x gradlew
./gradlew photon-targeting:build photon-lib:build -Pbuildalldesktop -i
- run: ./gradlew photon-lib:publish photon-targeting:publish
- run: ./gradlew photon-lib:publish photon-targeting:publish -Pbuildalldesktop
name: Publish
env:
ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }}
if: github.event_name == 'push'
if: github.event_name == 'push' && github.repository_owner == 'photonvision'
# Copy artifacts to build/outputs/maven
- run: ./gradlew photon-lib:publish photon-targeting:publish outputVersion -PcopyOfflineArtifacts
- run: ./gradlew photon-lib:publish photon-targeting:publish -PcopyOfflineArtifacts -Pbuildalldesktop
- uses: actions/upload-artifact@v4
with:
name: maven-${{ matrix.artifact-name }}
Expand Down Expand Up @@ -196,12 +196,12 @@ jobs:
- name: Publish
run: |
chmod +x gradlew
./gradlew photon-lib:publish photon-targeting:publish
./gradlew photon-lib:publish photon-targeting:publish ${{ matrix.build-options }}
env:
ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }}
if: github.event_name == 'push'
if: github.event_name == 'push' && github.repository_owner == 'photonvision'
# Copy artifacts to build/outputs/maven
- run: ./gradlew photon-lib:publish photon-targeting:publish outputVersion -PcopyOfflineArtifacts
- run: ./gradlew photon-lib:publish photon-targeting:publish -PcopyOfflineArtifacts ${{ matrix.build-options }}
- uses: actions/upload-artifact@v4
with:
name: maven-${{ matrix.artifact-name }}
Expand Down
17 changes: 0 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,6 @@ ext {
println("Publishing Photonlib to " + photonMavenURL)
}

task outputVersion() {
def versionFile = file("$allOutputsFolder/version.txt")

description = 'Prints the versions of wpilib to a file for use by the downstream packaging project'
group = 'Build'
outputs.files(versionFile)

doFirst {
buildDir.mkdir()
allOutputsFolder.mkdir()
}

doLast {
versionFile.write versionString
}
}

spotless {
java {
target fileTree('.') {
Expand Down

0 comments on commit 292c7a1

Please sign in to comment.