mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-08 05:47:07 +09:00
ci: publish to maven
This commit is contained in:
parent
399d7fa46c
commit
97252d5c5b
3 changed files with 61 additions and 0 deletions
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
|
@ -5,6 +5,9 @@ on:
|
|||
name: Build
|
||||
jobs:
|
||||
build-mac-win-android-ios:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
- name: Install Go
|
||||
|
@ -162,6 +165,12 @@ jobs:
|
|||
sudo /usr/sbin/purge
|
||||
gtar -czvf android_lib_${VERSION}.tar.gz lib.aar protobuf
|
||||
mv android_lib_${VERSION}.tar.gz .release/
|
||||
- name: Publish android lib to maven
|
||||
run: |
|
||||
gradle publish
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_USER: ${{ github.actor }}
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -10,3 +10,4 @@ package-lock.json
|
|||
lib-server/service.pb.go
|
||||
dist/cli
|
||||
grpc-web
|
||||
.gradle
|
||||
|
|
51
build.gradle
Normal file
51
build.gradle
Normal file
|
@ -0,0 +1,51 @@
|
|||
apply plugin: 'maven-publish' // Apply this plugin at the top of your library build.gradle
|
||||
apply plugin: "io.freefair.git-version"
|
||||
|
||||
def githubProperties = new Properties()
|
||||
//githubProperties.load(new FileInputStream(rootProject.file("github.properties"))) //Set env variable GPR_USER & GPR_API_KEY if not adding a properties file
|
||||
|
||||
|
||||
def getArtificatId = { ->
|
||||
return "android-mw" // Replace with library name ID
|
||||
}
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
maven {
|
||||
url "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath "io.freefair.gradle:git-plugin:6.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
bar(MavenPublication) {
|
||||
groupId 'io.anytype' // Replace with group ID
|
||||
artifactId getArtificatId()
|
||||
artifact("lib.aar")
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "GitHubPackages"
|
||||
/** Configure path of your package repository on Github
|
||||
** Replace GITHUB_USERID with your/organisation Github userID
|
||||
** and REPOSITORY with the repository name on GitHub
|
||||
*/
|
||||
url = uri("https://maven.pkg.github.com/anytypeio/go-anytype-middleware")
|
||||
credentials {
|
||||
/** Create github.properties in root project folder file with
|
||||
** gpr.usr=GITHUB_USER_ID & gpr.key=PERSONAL_ACCESS_TOKEN
|
||||
** Set env variable GPR_USER & GPR_API_KEY if not adding a properties file**/
|
||||
|
||||
username = githubProperties['gpr.usr'] ?: System.getenv("GITHUB_USER")
|
||||
password = githubProperties['gpr.key'] ?: System.getenv("GITHUB_TOKEN")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue