From 3de7c92fc1295a6f53e42fd3df3ea99cb387fefb Mon Sep 17 00:00:00 2001 From: Philipp Gritsch Date: Mon, 26 Aug 2024 11:29:35 +0200 Subject: [PATCH] add github deploy action --- .github/maven/settings.xml | 12 ++++++++++++ .github/workflows/publish.yml | 31 +++++++++++++++++++++++++++++++ build.gradle | 11 +++++++++++ pom.xml => pom_old.xml | 0 4 files changed, 54 insertions(+) create mode 100644 .github/maven/settings.xml create mode 100644 .github/workflows/publish.yml rename pom.xml => pom_old.xml (100%) diff --git a/.github/maven/settings.xml b/.github/maven/settings.xml new file mode 100644 index 0000000..a38f1e2 --- /dev/null +++ b/.github/maven/settings.xml @@ -0,0 +1,12 @@ + + + + + github + ${env.GITHUB_ACTOR} + ${env.GITHUB_TOKEN} + + + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..57ee505 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish jFaaS:jFaaS:x.y.z to GitHub Packages + +on: + workflow_dispatch: + inputs: + version: + description: 'Version of the JAR to publish (e.g., 1.0.0, 1.0.1, etc.)' + required: true + default: '1.0-SNAPSHOT' # Optional, you can set a default version if you want + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + + - name: Create jar file + run: ./gradlew clean build && ./gradlew shadowJar + + - name: Deploy JAR to GitHub Packages + run: mvn deploy:deploy-file -Dfile=./build/libs/jFaaS-all.jar -DgroupId=jfaas -DartifactId=jfaas -Dversion=${{ github.event.inputs.version }} -Dpackaging=jar -DrepositoryId=github -Durl=https://maven.pkg.github.com/sashkoristov/jFaaS -DgeneratePom=true -Dmaven.resolver.transport=wagon -e -X + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build.gradle b/build.gradle index 24c496c..21f53ce 100644 --- a/build.gradle +++ b/build.gradle @@ -48,6 +48,17 @@ publishing { from(components.java) } } + + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/sashkoristov/jFaaS" + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } } mainClassName = 'jFaaS.Gateway' diff --git a/pom.xml b/pom_old.xml similarity index 100% rename from pom.xml rename to pom_old.xml