Skip to content

Commit

Permalink
Merge pull request #1 from Privado-Inc/release/gh_packages
Browse files Browse the repository at this point in the history
Initial work for gh package release
  • Loading branch information
karan-batavia authored May 27, 2024
2 parents 09bc7ec + c2b4f19 commit ee0d2c8
Show file tree
Hide file tree
Showing 10 changed files with 132 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/gh_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release
on:
push:
tags: ["*"]
workflow_dispatch:
jobs:
release:
concurrency: release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: export $GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 19
- uses: actions/cache@v2
with:
path: |
~/.sbt
~/.coursier
key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }}
- run: sbt +test ciReleaseTagNextVersion ++3.4.1 publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ jobs:
~/.coursier
key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }}
- run: sbt scalafmtCheck Test/scalafmtCheck +test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions core-tests/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@ libraryDependencies ++= Seq(
)

Test / testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v")


githubOwner := "Privado-Inc"
githubRepository := "overflowdb"

credentials +=
Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"Privado-Inc",
sys.env.getOrElse("GITHUB_TOKEN", "N/A")
)
11 changes: 11 additions & 0 deletions core/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,14 @@ libraryDependencies ++= Seq(
"com.h2database" % "h2-mvstore" % "1.4.200",
"org.slf4j" % "slf4j-api" % "2.0.7"
)

githubOwner := "Privado-Inc"
githubRepository := "overflowdb"

credentials +=
Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"Privado-Inc",
sys.env.getOrElse("GITHUB_TOKEN", "N/A")
)
12 changes: 12 additions & 0 deletions formats/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@ libraryDependencies ++= Seq(
)

Test / console / scalacOptions -= "-Xlint"


githubOwner := "Privado-Inc"
githubRepository := "overflowdb"

credentials +=
Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"Privado-Inc",
sys.env.getOrElse("GITHUB_TOKEN", "N/A")
)
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
addSbtPlugin("io.shiftleft" % "sbt-ci-release-early" % "2.0.19")
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1")
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")
12 changes: 12 additions & 0 deletions testdomains/build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
name := "testdomains"

publish / skip := true


githubOwner := "Privado-Inc"
githubRepository := "overflowdb"

credentials +=
Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"Privado-Inc",
sys.env.getOrElse("GITHUB_TOKEN", "N/A")
)
12 changes: 12 additions & 0 deletions traversal-tests/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,15 @@ name := "overflowdb-traversal-tests"
publish / skip := true

Test / console / scalacOptions -= "-Xlint"


githubOwner := "Privado-Inc"
githubRepository := "overflowdb"

credentials +=
Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"Privado-Inc",
sys.env.getOrElse("GITHUB_TOKEN", "N/A")
)
11 changes: 11 additions & 0 deletions traversal/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,14 @@ libraryDependencies ++= Seq(
"net.oneandone.reflections8" % "reflections8" % "0.11.7",
"de.vandermeer" % "asciitable" % "0.3.2",
)

githubOwner := "Privado-Inc"
githubRepository := "overflowdb"

credentials +=
Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"Privado-Inc",
sys.env.getOrElse("GITHUB_TOKEN", "N/A")
)
31 changes: 31 additions & 0 deletions upstream_sync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

set -e

git remote add upstream https://github.com/ShiftLeftSecurity/overflowdb

usage() {
echo "Usage: $0 [--publish]"
exit 1
}

PUBLISH=false
while [[ "$#" -gt 0 ]]; do
case $1 in
--publish) PUBLISH=true ;;
*) usage ;;
esac
shift
done

git fetch upstream

git checkout sync
git merge upstream/master
git push origin sync

if [ "$PUBLISH" = true ]; then
git checkout master
git merge sync
git push origin master
fi

0 comments on commit ee0d2c8

Please sign in to comment.