Skip to content

Commit

Permalink
Configure publish
Browse files Browse the repository at this point in the history
  • Loading branch information
BaekGeunYoung committed Mar 13, 2024
1 parent 44a827b commit 52c6320
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 46 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: CI

on: [push, pull_request]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:
strategy:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: publish

on:
push:
tags:
- 'v*'
workflow_dispatch:

env:
PACKAGE_GITHUB_TOKEN: ${{ secrets.IAMPORT_COMMON }}

jobs:
publish:
name: Build and Publish
strategy:
matrix:
os: [ ubuntu-latest ]
scala: [ 2.13.6 ]
java: [ [email protected] ]
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sbt ++${{ matrix.scala }} publish
43 changes: 0 additions & 43 deletions .github/workflows/release.yml

This file was deleted.

22 changes: 19 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,27 @@ ThisBuild / resolvers ++= Resolver.sonatypeOssRepos("snapshots")

ThisBuild / versionScheme := Some("early-semver")

publish / skip := true
val commonPublishSettings = Seq(
credentials ++= Seq(
Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
scala.sys.env.getOrElse("GITHUB_ACTOR", ""),
scala.sys.env.getOrElse("GITHUB_TOKEN", "")
)
),
publishTo := Some(
"GitHub Package Registry (portone-io/zio-grpc)" at "https://maven.pkg.github.com/portone-io/zio-grpc"
),
resolvers += "GitHub Package Registry (portone-io/zio-grpc)" at "https://maven.pkg.github.com/portone-io/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")),
homepage := Some(url("https://github.com/portone-io/zio-grpc")),
licenses := List(
"Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")
),
Expand Down Expand Up @@ -48,6 +61,7 @@ lazy val core = projectMatrix
"dev.zio" %%% "zio-test-sbt" % Version.zio % "test"
)
)
.settings(commonPublishSettings)
.jvmPlatform(
ScalaVersions,
Seq(
Expand Down Expand Up @@ -83,6 +97,7 @@ lazy val codeGen = projectMatrix
"com.thesamet.scalapb" %% "compilerplugin" % scalapb.compiler.Version.scalapbVersion
)
)
.settings(commonPublishSettings)
.jvmPlatform(scalaVersions = ScalaVersions)

lazy val codeGenJVM212 = codeGen.jvm(Scala212)
Expand All @@ -98,6 +113,7 @@ lazy val protocGenZio = protocGenProject("protoc-gen-zio", codeGenJVM212)
(assembly / assemblyMergeStrategy).value.apply(x)
}
)
.settings(commonPublishSettings)

lazy val e2eProtos =
projectMatrix
Expand Down

0 comments on commit 52c6320

Please sign in to comment.