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
[release] prep for initial github package
  • Loading branch information
karan-batavia committed Jul 30, 2024
2 parents 0c169fb + c1897c9 commit f2f38a2
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/gh_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release
on:
push:
tags: ["*"]
jobs:
release:
concurrency: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: apt-get update
run: sudo apt-get update
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 21
- uses: actions/cache@v2
with:
path: |
~/.sbt
~/.coursier
key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }}
- run: sbt +test ciReleaseTagNextVersion
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: sbt ++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 @@ -20,3 +20,5 @@ jobs:
key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }}
- name: scalafmtCheck and tests
run: sbt scalafmtCheck Test/scalafmtCheck test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 11 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,17 @@ ThisBuild / compile / javacOptions ++= Seq(
Global / cancelable := true
Global / onChangedBuildSource := ReloadOnSourceChanges

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

credentials +=
Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"Privado-Inc",
sys.env.getOrElse("GITHUB_TOKEN", "N/A")
)

ThisBuild / publishTo := sonatypePublishToBundle.value
sonatypeCredentialHost := "s01.oss.sonatype.org"
ThisBuild / scmInfo := Some(
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.16")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.4")
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1")
addSbtPlugin("io.shiftleft" % "sbt-ci-release-early" % "2.0.19")
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")
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/joernio/flatgraph

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 f2f38a2

Please sign in to comment.