From fd8339b219558077e402cfceef7d8db414a58c73 Mon Sep 17 00:00:00 2001 From: BaekGeunYoung Date: Tue, 13 Dec 2022 18:18:17 +0900 Subject: [PATCH] configure publish --- .github/workflows/publish.yml | 40 ++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 43 ----------------------------------- build.sbt | 17 ++++++++++++-- 3 files changed, 55 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..ae8721088 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,40 @@ +name: publish + +on: + push: + tags: + - 'v*' + workflow_dispatch: + +jobs: + publish: + name: Build and Publish + strategy: + matrix: + os: [ ubuntu-latest ] + scala: [ 2.13.6 ] + java: [ openjdk@1.17.0 ] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v2 + + - name: Setup Java and Scala + uses: olafurpg/setup-scala@v13 + with: + java-version: ${{ matrix.java }} + + - name: Cache sbt + uses: actions/cache@v2 + with: + path: | + ~/.sbt + ~/.ivy2/cache + ~/.coursier/cache/v1 + ~/.cache/coursier/v1 + ~/AppData/Local/Coursier/Cache/v1 + ~/Library/Caches/Coursier/v1 + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: publish + run: sbt ++${{ matrix.scala }} publish diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 9892e312b..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Release -on: - push: - branches: [master] - tags: ["*"] -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-node@v4 - with: - node-version: '16.x' - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: temurin - cache: sbt - - name: Update docs - run: | - git config --global user.name "ZIO-gRPC Docs" - git config --global user.email "zio-grpc-docs@users.noreply.github.com" - eval "$(ssh-agent -s)" - echo "$TOKEN" | ssh-add - - sbt docs/mdoc - cd website - yarn install - yarn deploy - env: - TOKEN: ${{secrets.DEPLOY_KEY}} - USE_SSH: true - GIT_USER: git - - uses: olafurpg/setup-gpg@v3 - - name: Publish ${{ github.ref }} - run: sbt ci-release - env: - PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} - PGP_SECRET: ${{ secrets.PGP_SECRET }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} diff --git a/build.sbt b/build.sbt index bab867792..b7cc8847c 100644 --- a/build.sbt +++ b/build.sbt @@ -13,14 +13,27 @@ ThisBuild / resolvers ++= Resolver.sonatypeOssRepos("snapshots") ThisBuild / versionScheme := Some("early-semver") -publish / skip := true +ThisBuild / resolvers += "GitHub Package Registry (iamport/zio-grpc)" at "https://maven.pkg.github.com/iamport/zio-grpc" + +ThisBuild / credentials ++= Seq( + Credentials( + "GitHub Package Registry", + "maven.pkg.github.com", + scala.sys.env("GITHUB_ACTOR"), + scala.sys.env("GITHUB_TOKEN") + ) +) + +publishTo := Some("GitHub Package Registry (iamport/zio-grpc)" at "https://maven.pkg.github.com/iamport/zio-grpc") -sonatypeProfileName := "com.thesamet" +publish / skip := true inThisBuild( List( organization := "com.thesamet.scalapb.zio-grpc", homepage := Some(url("https://github.com/scalapb/zio-grpc")), + organization := "finance.chai", + homepage := Some(url("https://github.com/iamport/zio-grpc")), licenses := List( "Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0") ),