Skip to content

Commit

Permalink
refactor(publish): publish to ghr
Browse files Browse the repository at this point in the history
  • Loading branch information
datYori committed Jun 17, 2024
1 parent e57ef8e commit d935197
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
push:
tags:
- "v*.*.*"

permissions:
contents: read # This is required for actions/checkout
packages: write

jobs:
publish-snapi-components:
runs-on: self-hosted
Expand All @@ -32,6 +37,11 @@ jobs:
fetch-depth: 0
- name: build all
run: ./rebuild.sh
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.PGP_SECRET }}
passphrase: ${{ secrets.PGP_PASSPHRASE }}
- name: sbt ci-release
run: |
export HOME="/home/sbtuser"
Expand All @@ -40,15 +50,9 @@ jobs:
yes n | sdk install java 21.0.1-graalce || true
sdk use java 21.0.1-graalce
echo "$SDKMAN_DIR/candidates/java/current/bin" >> $GITHUB_PATH
sbt ci-release
sbt clean publishSigned
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
CI_CLEAN: clean
CI_RELEASE: publishSigned
CI_SNAPSHOT_RELEASE: publish
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: evaluate produced version
shell: bash
run: echo "VERSION=$(cat ./version)" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ThisBuild / credentials += Credentials(
sys.env.getOrElse("GITHUB_TOKEN", "")
)

ThisBuild/ resolvers += "Github RAW main repo" at "https://maven.pkg.github.com/raw-labs/raw"
ThisBuild/ resolvers += "Github RAW main repo" at "https://maven.pkg.github.com/raw-labs/snapi"


val writeVersionToFile = taskKey[Unit]("Writes the project version to a file at the root.")
Expand Down
4 changes: 3 additions & 1 deletion project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ object BuildSettings {
updateOptions := updateOptions.in(Global).value.withCachedResolution(true),
publish / skip := false,
publishSigned / skip := false,
publishLocal / skip := false
publishLocal / skip := false,
publishTo := Some("GitHub raw-labs Apache Maven Packages" at "https://maven.pkg.github.com/raw-labs/raw"),
publishMavenStyle := true
)

lazy val commonCompileSettings = Seq(
Expand Down

0 comments on commit d935197

Please sign in to comment.