From 562e0357cb44d40aeeba60c6fa6f8b453d397e30 Mon Sep 17 00:00:00 2001 From: Nico Date: Sun, 21 Apr 2024 15:36:54 +0200 Subject: [PATCH] Publishing configuration --- .github/workflows/publish.yml | 46 ----------------------------------- .github/workflows/test.yml | 6 ++--- build.sbt | 18 +++++++------- project/plugins.sbt | 1 + 4 files changed, 13 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/publish.yml create mode 100644 project/plugins.sbt diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index d0dcce3..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Publish -on: - push: - tags: - - 'v*' - workflow_dispatch: -jobs: - test: - uses: ./.github/workflows/test.yml - publish: - needs: test - environment: production - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup JDK - uses: actions/setup-java@v3 - with: - distribution: oracle - java-version: 17 - - name: Configure GPG Key - env: - GPG_KEY: ${{ secrets.GPG_KEY }} - run: | - echo -n "$GPG_KEY" | base64 --decode | gpg --import - - name: Prepare environment - env: - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - run: | - mkdir -p ~/.sbt/1.0 - touch ~/.sbt/1.0/sonatype.sbt - echo "credentials += Credentials(Path.userHome / \".sbt\" / \"sonatype_credentials\")" > ~/.sbt/1.0/sonatype.sbt - touch ~/.sbt/sonatype_credentials - echo "realm=Sonatype Nexus Repository Manager" > ~/.sbt/sonatype_credentials - echo "host=s01.oss.sonatype.org" >> ~/.sbt/sonatype_credentials - echo "user=$SONATYPE_USERNAME" >> ~/.sbt/sonatype_credentials - echo "password=$SONATYPE_PASSWORD" >> ~/.sbt/sonatype_credentials - mkdir ~/.sbt/1.0/plugins - touch ~/.sbt/1.0/plugins/gpg.sbt - echo "addSbtPlugin(\"com.github.sbt\" % \"sbt-pgp\" % \"2.1.2\")" > ~/.sbt/1.0/plugins/gpg.sbt - - name: Deploy - run: sbt publishSigned - - name: Message - run: echo "Staging repository created at https://s01.oss.sonatype.org/#stagingRepositories" \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3340b8e..e4a1801 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,11 +5,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: oracle java-version: 17 - name: Build and Test - run: sbt test \ No newline at end of file + run: sbt test diff --git a/build.sbt b/build.sbt index 961ef80..356cc7c 100644 --- a/build.sbt +++ b/build.sbt @@ -1,14 +1,18 @@ // Project info name := "CmplxLib" homepage := Some(url("https://github.com/ScalaMath/CmplxLib")) +version := "2.0" +description := "A Scala library for complex numbers, complex vectors, and complex matrices" +// Organization info organization := "io.github.scalamath" organizationName := "ScalaMath" organizationHomepage := Some(url("https://github.com/ScalaMath")) -version := "2.0" -description := "A Scala library for complex numbers, complex vectors, and complex matrices" // Project scala version scalaVersion := "2.13.12" +// Do not append the scala version to the generated artifact +crossPaths := false + // VecMatLib dependency libraryDependencies += "io.github.scalamath" % "vecmatlib" % "3.0" @@ -43,11 +47,7 @@ licenses := List( "Apache 2" -> new URL("https://www.apache.org/licenses/LICENSE-2.0.txt") ) -// Maven publishing +// Publish to local repository pomIncludeRepository := { _ => false } -publishTo := { - val nexus = "https://s01.oss.sonatype.org/" - if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots") - else Some("releases" at nexus + "service/local/staging/deploy/maven2") -} -publishMavenStyle := true \ No newline at end of file +publishTo := Some(Resolver.file("local-ivy", file(Path.userHome + "/.ivy2"))) +publishMavenStyle := true diff --git a/project/plugins.sbt b/project/plugins.sbt new file mode 100644 index 0000000..29e1b63 --- /dev/null +++ b/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1") \ No newline at end of file