Skip to content

Commit 5b3dd5c

Browse files
author
Anton Troshin
committed
Merge branch 'master' of github.com:SupersonicAds/sonic-dependency-tree into feature/antontroshin/projectReverseDependencyTree
� Conflicts: � README.md � project/build.properties
2 parents 42a7e69 + 45631a8 commit 5b3dd5c

File tree

9 files changed

+196
-57
lines changed

9 files changed

+196
-57
lines changed

.github/workflows/ci.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# This file was automatically generated by sbt-github-actions using the
2+
# githubWorkflowGenerate task. You should add and commit this file to
3+
# your git repository. It goes without saying that you shouldn't edit
4+
# this file by hand! Instead, if you wish to make changes, you should
5+
# change your sbt build configuration to revise the workflow description
6+
# to meet your needs, then regenerate this file.
7+
8+
name: Continuous Integration
9+
10+
on:
11+
pull_request:
12+
branches: ['*']
13+
push:
14+
branches: ['*']
15+
tags: [v*]
16+
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
20+
jobs:
21+
build:
22+
name: Build and Test
23+
strategy:
24+
matrix:
25+
os: [ubuntu-latest]
26+
scala: [2.12.12]
27+
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- name: Checkout current branch (full)
31+
uses: actions/checkout@v2
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Setup Java and Scala
36+
uses: olafurpg/setup-scala@v10
37+
with:
38+
java-version: ${{ matrix.java }}
39+
40+
- name: Cache sbt
41+
uses: actions/cache@v2
42+
with:
43+
path: |
44+
~/.sbt
45+
~/.ivy2/cache
46+
~/.coursier/cache/v1
47+
~/.cache/coursier/v1
48+
~/AppData/Local/Coursier/Cache/v1
49+
~/Library/Caches/Coursier/v1
50+
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
51+
52+
- name: Check that workflows are up to date
53+
run: sbt ++${{ matrix.scala }} githubWorkflowCheck
54+
55+
- run: sbt ++${{ matrix.scala }} test scripted
56+
57+
- name: Compress target directories
58+
run: tar cf targets.tar target project/target
59+
60+
- name: Upload target directories
61+
uses: actions/upload-artifact@v2
62+
with:
63+
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
64+
path: targets.tar
65+
66+
publish:
67+
name: Publish Artifacts
68+
needs: [build]
69+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
70+
strategy:
71+
matrix:
72+
os: [ubuntu-latest]
73+
scala: [2.12.12]
74+
75+
runs-on: ${{ matrix.os }}
76+
steps:
77+
- name: Checkout current branch (full)
78+
uses: actions/checkout@v2
79+
with:
80+
fetch-depth: 0
81+
82+
- name: Setup Java and Scala
83+
uses: olafurpg/setup-scala@v10
84+
with:
85+
java-version: ${{ matrix.java }}
86+
87+
- name: Cache sbt
88+
uses: actions/cache@v2
89+
with:
90+
path: |
91+
~/.sbt
92+
~/.ivy2/cache
93+
~/.coursier/cache/v1
94+
~/.cache/coursier/v1
95+
~/AppData/Local/Coursier/Cache/v1
96+
~/Library/Caches/Coursier/v1
97+
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
98+
99+
- name: Download target directories (2.12.12)
100+
uses: actions/download-artifact@v2
101+
with:
102+
name: target-${{ matrix.os }}-2.12.12-${{ matrix.java }}
103+
104+
- name: Inflate target directories (2.12.12)
105+
run: |
106+
tar xf targets.tar
107+
rm targets.tar
108+
109+
- env:
110+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
111+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
112+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
113+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
114+
run: sbt ++${{ matrix.scala }} ci-release

.github/workflows/clean.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This file was automatically generated by sbt-github-actions using the
2+
# githubWorkflowGenerate task. You should add and commit this file to
3+
# your git repository. It goes without saying that you shouldn't edit
4+
# this file by hand! Instead, if you wish to make changes, you should
5+
# change your sbt build configuration to revise the workflow description
6+
# to meet your needs, then regenerate this file.
7+
8+
name: Clean
9+
10+
on: push
11+
12+
jobs:
13+
delete-artifacts:
14+
name: Delete Artifacts
15+
runs-on: ubuntu-latest
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
steps:
19+
- name: Delete artifacts
20+
run: |
21+
# Customize those three lines with your repository and credentials:
22+
REPO=${GITHUB_API_URL}/repos/${{ github.repository }}
23+
24+
# A shortcut to call GitHub API.
25+
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; }
26+
27+
# A temporary file which receives HTTP response headers.
28+
TMPFILE=/tmp/tmp.$$
29+
30+
# An associative array, key: artifact name, value: number of artifacts of that name.
31+
declare -A ARTCOUNT
32+
33+
# Process all artifacts on this repository, loop on returned "pages".
34+
URL=$REPO/actions/artifacts
35+
while [[ -n "$URL" ]]; do
36+
37+
# Get current page, get response headers in a temporary file.
38+
JSON=$(ghapi --dump-header $TMPFILE "$URL")
39+
40+
# Get URL of next page. Will be empty if we are at the last page.
41+
URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*<//' -e 's/>.*//')
42+
rm -f $TMPFILE
43+
44+
# Number of artifacts on this page:
45+
COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') ))
46+
47+
# Loop on all artifacts on this page.
48+
for ((i=0; $i < $COUNT; i++)); do
49+
50+
# Get name of artifact and count instances of this name.
51+
name=$(jq <<<$JSON -r ".artifacts[$i].name?")
52+
ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1))
53+
54+
id=$(jq <<<$JSON -r ".artifacts[$i].id?")
55+
size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") ))
56+
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size
57+
ghapi -X DELETE $REPO/actions/artifacts/$id
58+
done
59+
done

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ lib_managed/
1212
src_managed/
1313
project/boot/
1414
project/plugins/project/
15+
.bloop
16+
/.bsp
17+
.metals
18+
metals.sbt
1519

1620
# Scala-IDE specific
1721
.scala_dependencies

.travis.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# sonic-dependency-tree
22

3-
[![Build Status](https://travis-ci.org/SupersonicAds/sonic-dependency-tree.svg?branch=master)](https://travis-ci.org/SupersonicAds/sonic-dependency-tree)
3+
[![Build Status](https://github.com/SupersonicAds/sonic-dependency-tree/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/SupersonicAds/sonic-dependency-tree/actions?query=branch%3Amaster)
4+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.supersonic/sonic-dependency-tree_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.supersonic/sonic-dependency-tree_2.12)
45

56
SBT plugin for retrieving Scala modules and libraries dependencies and outputs it as JSON. As an identifier for current dependencies, we use Git commit.
67
In addition, there's an option to upload the current commit project's dependencies to Amazon S3.
@@ -15,8 +16,6 @@ It helps to keep track of module dependencies and library version used in each m
1516
Add the plugin as SBT dependency to your `project/plugins.sbt`
1617

1718
```
18-
resolvers += Resolver.bintrayRepo("ironsonic", "sbt-plugins")
19-
2019
addSbtPlugin("com.supersonic" % "sonic-dependency-tree" % "0.0.3")
2120
```
2221

build.sbt

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
enablePlugins(ScriptedPlugin)
2-
enablePlugins(BuildInfoPlugin)
32

4-
organization := "com.supersonic"
53
name := "sonic-dependency-tree"
64
scalacOptions ++= List(
75
"-encoding", "UTF-8",
@@ -15,15 +13,7 @@ scalacOptions ++= List(
1513
"-Xlint",
1614
"-Ypartial-unification")
1715

18-
buildInfoKeys := List[BuildInfoKey](
19-
name,
20-
version,
21-
scalaVersion,
22-
sbtVersion,
23-
"gitCommit" -> git.gitHeadCommit.value.getOrElse(""),
24-
"gitDescribedVersion" -> git.gitDescribedVersion.value.getOrElse(""))
25-
26-
buildInfoPackage := organization.value
16+
sonatypeCredentialHost := Sonatype.sonatype01
2717

2818
makePomConfiguration := makePomConfiguration.value.withConfigurations(Configurations.defaultMavenConfigurations)
2919

@@ -34,15 +24,23 @@ scriptedLaunchOpts += ("-Dplugin.version=" + version.value)
3424
scriptedBufferLog := false
3525

3626
inThisBuild(List(
27+
organization := "com.supersonic",
3728
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
3829
homepage := Some(url("https://github.com/SupersonicAds/sonic-dependency-tree")),
3930
developers := List(Developer("SupersonicAds", "SupersonicAds", "SupersonicAds", url("https://github.com/SupersonicAds"))),
4031
scmInfo := Some(ScmInfo(url("https://github.com/SupersonicAds/sonic-dependency-tree"), "scm:git:[email protected]:SupersonicAds/sonic-dependency-tree.git")),
4132

42-
pgpPublicRing := file("./travis/local.pubring.asc"),
43-
pgpSecretRing := file("./travis/local.secring.asc"),
44-
releaseEarlyEnableSyncToMaven := false,
45-
releaseEarlyWith := BintrayPublisher))
33+
githubWorkflowPublishTargetBranches := Seq(RefPredicate.StartsWith(Ref.Tag("v"))),
34+
githubWorkflowTargetTags ++= Seq("v*"),
35+
githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("test", "scripted"))),
36+
githubWorkflowPublish := Seq(
37+
WorkflowStep.Sbt(
38+
List("ci-release"),
39+
env = Map(
40+
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
41+
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
42+
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
43+
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}")))))
4644

4745
libraryDependencies ++= Seq(
4846
"com.typesafe.play" %% "play-json" % "2.8.0",

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version = 1.4.3
1+
sbt.version = 1.4.9

project/plugins.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
22

3-
addSbtPlugin("ch.epfl.scala" % "sbt-release-early" % "2.1.1")
4-
53
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.9.3")
64

7-
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0")
5+
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
6+
7+
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.10.1")

travis/secrets.tar.enc

-8.02 KB
Binary file not shown.

0 commit comments

Comments
 (0)