Skip to content

Commit 75e7a82

Browse files
committed
Add maven artifact upload integration
1 parent 0801943 commit 75e7a82

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

.github/workflows/build.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: TrackAPI CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- run: |
11+
ref=`echo ${github_ref} | sed -e 's,refs/heads/,,' | tr '/' '-'`
12+
echo $ref
13+
echo "::set-env name=ref::$ref"
14+
env:
15+
github_ref: ${{ github.ref }}
16+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
17+
- name: keyscan
18+
run: mkdir -p ~/.ssh/ && ssh-keyscan -t rsa teamopenindustry.cc >> ~/.ssh/known_hosts
19+
- name: secrets
20+
env:
21+
MAVENCI: ${{ secrets.MAVENCI }}
22+
run: echo "${MAVENCI}" >> publish_key
23+
- name: Gradle uploadArchives
24+
run: ./gradlew uploadArchives
25+
- name: cleanup
26+
run: rm publish_key
27+
- uses: actions/upload-artifact@v2-preview
28+
with:
29+
name: UniversalModCore-${{ env.ref }}
30+
path: build/libs/UniversalModCore-*.jar

build.gradle

+30-1
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1+
import cam72cam.universalmodcore.Util;
2+
13
buildscript {
24
repositories {
35
jcenter()
46
maven { url = "http://files.minecraftforge.net/maven" }
7+
maven { url = "https://teamopenindustry.cc/maven" }
58
}
69
dependencies {
710
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
11+
classpath 'cam72cam.universalmodcore:UniversalModCoreGradle:0.1.3'
812
}
913
}
1014
apply plugin: 'net.minecraftforge.gradle.forge'
1115
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
16+
apply plugin: 'maven'
1217

1318

14-
version = "1.2"
19+
String baseVersion = "1.2"
20+
if (!"release".equalsIgnoreCase(System.getProperty("target"))) {
21+
baseVersion += "-" + Util.GitRevision()
22+
}
23+
version = "1.12.2-forge-" + baseVersion
1524
group = "trackapi" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
1625
archivesBaseName = "TrackAPI"
1726

@@ -75,3 +84,23 @@ processResources {
7584
exclude 'mcmod.info'
7685
}
7786
}
87+
88+
task deployJar(type: Jar)
89+
90+
configurations {
91+
deployerJars
92+
}
93+
94+
dependencies {
95+
deployerJars "org.apache.maven.wagon:wagon-ssh:2.9"
96+
}
97+
98+
uploadArchives {
99+
repositories.mavenDeployer {
100+
configuration = configurations.deployerJars
101+
repository(url: "scp://teamopenindustry.cc/var/www/html/maven/") {
102+
authentication(userName: "mavenci", privateKey: "publish_key")
103+
}
104+
}
105+
}
106+

0 commit comments

Comments
 (0)