Skip to content

Commit e835e4c

Browse files
committed
Welcome artifacts
1 parent 8136871 commit e835e4c

File tree

5 files changed

+149
-7
lines changed

5 files changed

+149
-7
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
2+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
3+
4+
name: Gradle Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up JDK 16
21+
uses: actions/setup-java@v2
22+
with:
23+
java-version: '16'
24+
distribution: 'zulu'
25+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
26+
settings-path: ${{ github.workspace }} # location for the settings.xml file
27+
28+
- name: Build with Gradle
29+
run: gradle build
30+
env:
31+
USERNAME: ${{ github.actor }}
32+
TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
35+
# the publishing section of your build.gradle
36+
- name: Publish to GitHub Packages
37+
run: gradle publish
38+
env:
39+
USERNAME: ${{ github.actor }}
40+
TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,53 @@
11
![Kores-BytecodeWriter](https://github.com/JonathanxD/Kores-BytecodeWriter/blob/version/4.0.0/Kores-bytecode.png?raw=true)
22

3-
[![wercker status](https://app.wercker.com/status/e90fdff200417e9ba8e472ad9d0aca23/s/version/4.0.0 "wercker status")](https://app.wercker.com/project/byKey/e90fdff200417e9ba8e472ad9d0aca23)
43
[![jitpack](https://jitpack.io/v/JonathanxD/Kores-BytecodeWriter.svg)](https://jitpack.io/#JonathanxD/Kores-BytecodeWriter)
54
[![Discord](https://img.shields.io/discord/291407467286364164.svg)](https://discord.gg/3cQWmtj)
5+
[![Actions](https://img.shields.io/github/workflow/status/koresframework/Kores-BytecodeWriter/Gradle%20Package)](https://github.com/koresframework/Kores-BytecodeWriter/actions)
6+
[![Packages](https://img.shields.io/github/v/tag/koresframework/Kores-BytecodeWriter)](https://github.com/orgs/koresframework/packages?repo_name=Kores-BytecodeWriter)
7+
8+
## How to use Kores-BytecodeWriter
9+
10+
Kores-BytecodeWriter is now using [GitHub Packages](https://github.com/orgs/koresframework/packages?repo_name=Kores-BytecodeWriter) to distribute its binary files instead of [jitpack.io](https://jitpack.io) (because jitpack still not support all JDK versions and sometimes `jitpack.yml` simply do not work).
11+
12+
In order to be able to download Kores-BytecodeWriter Artifacts, you will need to configure your global `$HOME/.gradle/gradle.properties` to store your username and a [PAT](https://github.com/settings/tokens) with `read:packages` permission:
13+
14+
```properties
15+
USERNAME=GITHUB_USERNAME
16+
TOKEN=PAT
17+
```
18+
19+
Then configure your `build.gradle` as the following:
20+
21+
```gradle
22+
def GITHUB_USERNAME = project.findProperty("USERNAME") ?: System.getenv("USERNAME")
23+
def GITHUB_PAT = project.findProperty("TOKEN") ?: System.getenv("TOKEN")
24+
25+
repositories {
26+
mavenCentral()
27+
maven {
28+
url "https://maven.pkg.github.com/jonathanxd/jwiutils"
29+
credentials {
30+
username = GITHUB_USERNAME
31+
password = GITHUB_PAT
32+
}
33+
}
34+
maven {
35+
url "https://maven.pkg.github.com/jonathanxd/bytecodedisassembler"
36+
credentials {
37+
username = GITHUB_USERNAME
38+
password = GITHUB_PAT
39+
}
40+
}
41+
maven {
42+
url "https://maven.pkg.github.com/koresframework/kores"
43+
credentials {
44+
username = GITHUB_USERNAME
45+
password = GITHUB_PAT
46+
}
47+
}
48+
}
49+
50+
dependencies {
51+
implementation "com.github.koresframework:kores-bytecodewriter:4.1.9.bytecode" // Replace 4.1.9.bytecode with the preferred version
52+
}
53+
```

book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Steps

build.gradle

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,53 @@ buildscript {
1717

1818
}
1919

20-
group 'com.github.jonathanxd'
21-
version '4.1.2.bytecode.2'
20+
group 'com.github.koresframework'
21+
version '4.1.9.bytecode'
2222

2323
apply from: project(":Kores").file("gradle/common.gradle")
2424

25+
def GITHUB_USERNAME = project.findProperty("USERNAME") ?: System.getenv("USERNAME")
26+
def GITHUB_PAT = project.findProperty("TOKEN") ?: System.getenv("TOKEN")
27+
28+
repositories {
29+
mavenCentral()
30+
maven {
31+
url "https://maven.pkg.github.com/jonathanxd/jwiutils"
32+
credentials {
33+
username = GITHUB_USERNAME
34+
password = GITHUB_PAT
35+
}
36+
}
37+
maven {
38+
url "https://maven.pkg.github.com/jonathanxd/bytecodedisassembler"
39+
credentials {
40+
username = GITHUB_USERNAME
41+
password = GITHUB_PAT
42+
}
43+
}
44+
maven {
45+
url "https://maven.pkg.github.com/koresframework/kores"
46+
credentials {
47+
username = GITHUB_USERNAME
48+
password = GITHUB_PAT
49+
}
50+
}
51+
}
52+
2553
dependencies {
2654
// Developer note: Indev, we use this statement to compile and test BytecodeWriter.
2755
// When releasing a version of project, with git tag, we comment this statement and use compileOnly
2856
// with runtime dependency pointing to Kores published version
2957
//compile project(":Kores")
3058
compileOnly project(":Kores")
31-
runtimeOnly "com.github.koresframework.Kores:Kores:4.1.2.base"
32-
implementation 'com.github.JonathanxD:BytecodeDisassembler:2.3.0'
59+
runtimeOnly "com.github.koresframework:kores:4.1.9.base"
60+
implementation 'com.github.jonathanxd:bytecode-disassembler:2.4.1'
3361
implementation "org.ow2.asm:asm:9.2"
3462
implementation "org.ow2.asm:asm-analysis:9.2"
3563
implementation "org.ow2.asm:asm-tree:9.2"
3664
implementation "org.ow2.asm:asm-util:9.2"
3765

38-
testImplementation "com.github.JonathanxD.JwIUtils:links:$iutils_version"
66+
testImplementation "com.github.jonathanxd:links:$iutils_version"
3967
testImplementation project(":Kores")
4068
testImplementation project(path: ':Kores', configuration: 'tests')
4169
}
@@ -51,4 +79,29 @@ shadowJar {
5179
include(dependency("com.github.JonathanxD:BytecodeDisassembler"))
5280
include(dependency("com.github.JonathanxD:JwIUtils"))
5381
}
82+
}
83+
84+
publishing {
85+
repositories {
86+
maven {
87+
name = "Local"
88+
// change to point to your repo, e.g. http://my.org/repo
89+
url = "$buildDir/repo"
90+
}
91+
maven {
92+
name = "GitHubPackages"
93+
url = "https://maven.pkg.github.com/koresframework/kores-bytecodewriter"
94+
credentials {
95+
username = System.getenv("USERNAME")
96+
password = System.getenv("TOKEN")
97+
}
98+
}
99+
}
100+
publications {
101+
maven(MavenPublication) {
102+
artifactId 'kores-bytecodewriter'
103+
104+
artifact sourcesJar
105+
}
106+
}
54107
}

0 commit comments

Comments
 (0)