Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release] prep for initial github package #1

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading