Skip to content

Commit

Permalink
Add dev builds to maven
Browse files Browse the repository at this point in the history
  • Loading branch information
rzblue committed Nov 5, 2022
1 parent 12a8cee commit 67d6817
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 13 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
git config --global --add safe.directory /__w/navx-frc/navx-frc
git fetch --prune --unshallow
- name: Build with Gradle
run: ./gradlew build --max-workers 1 ${{ matrix.build-options }} ${{ env.EXTRA_GRADLE_ARGS }}
run: ./gradlew build --max-workers 1 -PbuildServer ${{ matrix.build-options }} ${{ env.EXTRA_GRADLE_ARGS }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
shell: bash
if: startsWith(github.ref, 'refs/tags/v')
- name: Build with Gradle
run: ./gradlew build -Pbuildalldesktop ${{ env.EXTRA_GRADLE_ARGS }}
run: ./gradlew build -Pbuildalldesktop -PbuildServer ${{ env.EXTRA_GRADLE_ARGS }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}
Expand Down Expand Up @@ -110,9 +110,11 @@ jobs:
name: Maven
path: ~/releases

publish-maven-release:
publish-maven:
name: Publish to Maven
if: |
github.repository_owner == 'rzblue' && startsWith(github.ref, 'refs/tags/v')
github.repository_owner == 'rzblue' &&
(startsWith(github.ref, 'refs/tags/v') || github.ref_name == 'main')
needs: combine
runs-on: ubuntu-latest
steps:
Expand All @@ -125,6 +127,17 @@ jobs:
with:
name: Maven
- name: Commit and push changes
if: |
github.ref_name == 'main'
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Add development build for ${{ github.sha }}" -m "CI Run ID: ${{ github.run_id }}" -m "CI Run Attempt: ${{ github.run_attempt }}"
git push
- name: Commit and push changes (Release)
if: |
startsWith(github.ref, 'refs/tags/v')
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

This is an *unofficial* repository containing source for the NavX FRC libraries for 2023.

Download the latest vendordep JSON on the [releases page](https://github.com/rzblue/navx-frc/releases)
Use this url to install the vendordep online:
`https://github.com/rzblue/navx-frc/maven/navx_frc.json`

Caveats:

Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id 'edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin' version '2020.2'
id 'edu.wpi.first.NativeUtils' version '2023.6.0'
id 'edu.wpi.first.GradleVsCode' version '1.3.0'
id 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin' version '4.1.0'
}

repositories {
Expand Down
15 changes: 7 additions & 8 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apply plugin: 'maven-publish'

ext.licenseFile = files("$rootDir/LICENSE.txt")

def gitCommitHash = 'git rev-parse --verify --short HEAD'.execute().text.trim()
def baseVersion = '2023.1.0-beta-1'
def pubVersion = baseVersion
// This isn't what releaseMode is for - fix this later
if(!project.hasProperty("releaseMode")) {
pubVersion += "-" + gitCommitHash
}
wpilibVersioning.buildServerMode = project.hasProperty('buildServer')
wpilibVersioning.releaseMode = project.hasProperty('releaseMode')

wpilibVersioning.useAllTags = true
wpilibVersioning.version.finalizeValue()

def pubVersion = wpilibVersioning.version.get()

def outputsFolder = file("$buildDir/outputs")

Expand Down Expand Up @@ -139,7 +139,6 @@ def releasesRepoUrl = "$buildDir/repos/releases"
publishing {
repositories {
maven {

url = releasesRepoUrl
}
}
Expand Down

0 comments on commit 67d6817

Please sign in to comment.