Skip to content

Commit

Permalink
Merge pull request #76 from frc5024/codespaces
Browse files Browse the repository at this point in the history
Add publish tools (I comitted to the wrong branch)
  • Loading branch information
ewpratten authored Sep 2, 2020
2 parents 6b8a13f + cbc53af commit e014388
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish

on:
push:
branches:
- master

jobs:

# Build the library
publish:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v1
with:
java-version: 11

- uses: eskatos/gradle-command-action@v1
with:
arguments: clean build buildRelease

- uses: chadly/prod-env-variables@v1
with:
keys: |
GHP_USERNAME
GHP_TOKEN
env:
GHP_USERNAME_PROD: ${{ github.actor }}
GHP_TOKEN_PROD: ${{ secrets.GITHUB_TOKEN }}

- uses: eskatos/gradle-command-action@v1
with:
arguments: publish
21 changes: 21 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ buildscript {
plugins {
id "com.gradle.build-scan" version "3.4.1"
id "java-library"
id "maven-publish"
}

// Load project dependancy configurations
Expand Down Expand Up @@ -197,4 +198,24 @@ task buildBeta(type: Copy) {
from "build/libs"
into "_release/jar"
include project.name + "-" + project.version +"-all.jar"
}

// GitHub Packages config
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/frc5024/lib5k")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GHP_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GHP_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
dependsOn buildRelease
from "_release/"+project.name + "-" + project.version +"-all.jar"
}
}
}

0 comments on commit e014388

Please sign in to comment.