Skip to content

Commit

Permalink
add publish setting & release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
reminia committed Dec 9, 2023
1 parent be247ac commit aafef5c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'sbt'

- name: publish plugin
run: sbt publish
18 changes: 18 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
version := "0.1.0-SNAPSHOT"
organization := "me.yceel"

val publishSettings = Seq(
publishTo := Some("Github repo" at "https://maven.pkg.github.com/" + System.getenv("GITHUB_REPOSITORY")),
publishMavenStyle := true,
credentials += Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
System.getenv("GITHUB_REPOSITORY_OWNER"),
System.getenv("GITHUB_TOKEN")
),
Test / packageDoc / publishArtifact := false,
Test / packageSrc / publishArtifact := false,
Test / packageBin / publishArtifact := false,
Compile / packageDoc / publishArtifact := false
)

lazy val root = (project in file("."))
.enablePlugins(SbtPlugin)
.settings(
name := "sbt-curl",
description := "sbt plugin for running curl commands",
sbtPlugin := true,
scriptedLaunchOpts ++= Seq("-Xmx1024M", "-Dplugin.version=" + version.value),
scriptedBufferLog := false,
Test / test := {
scripted.toTask("").value
}
)
.settings(publishSettings *)

0 comments on commit aafef5c

Please sign in to comment.