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

Hello, sbt-typelevel #12

Merged
merged 70 commits into from
Dec 30, 2021
Merged
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
6558c7c
Start afresh
armanbilge Dec 25, 2021
3077a90
Create NoPublishPlugin
armanbilge Dec 25, 2021
035cc79
we are self-hosting!
armanbilge Dec 25, 2021
98e2e74
Use no-publish on root actually :)
armanbilge Dec 25, 2021
b21d41c
typo
armanbilge Dec 25, 2021
570c496
Setup basic versioning
armanbilge Dec 25, 2021
d864c0e
Setup a mima and settings plugins
armanbilge Dec 25, 2021
b3cd73e
Better variable name
armanbilge Dec 25, 2021
f379386
Start working on the mima plugin
armanbilge Dec 25, 2021
c6d2fdf
Some progress on mima
armanbilge Dec 26, 2021
4e6606b
Add model for version
armanbilge Dec 27, 2021
7198a8d
MiMa plugin seems good
armanbilge Dec 27, 2021
657e7d1
Start working on settings plugin
armanbilge Dec 27, 2021
069bcee
ScalaJS settings depend on TL settings
armanbilge Dec 27, 2021
f195ffb
Add more settings
armanbilge Dec 28, 2021
b87e2d6
Bump sbt, setup scalafmt
armanbilge Dec 28, 2021
135f0c0
Setup ScmInfo setting
armanbilge Dec 28, 2021
0fdd453
Use V model for versioning plugin
armanbilge Dec 28, 2021
cc1acda
Distance-based versioning
armanbilge Dec 28, 2021
f0eafbe
Setup sonatype plugin
armanbilge Dec 28, 2021
2a1b5eb
Clarify bundle release logic
armanbilge Dec 28, 2021
90b37cb
Setup ci-release plugin
armanbilge Dec 28, 2021
74ed1fc
Supppress warnings
armanbilge Dec 28, 2021
5d8cfed
Add failsafe for tag/push double-publish
armanbilge Dec 28, 2021
ef3fa08
Setup ci-signing plugin
armanbilge Dec 28, 2021
df39173
Create CI plugin
armanbilge Dec 28, 2021
f87c5ca
Version scheme is early-semver
armanbilge Dec 28, 2021
de610ab
Generate workflow
armanbilge Dec 28, 2021
93e4d7b
Bikeshedding
armanbilge Dec 28, 2021
5ad198e
Create kernel plugin
armanbilge Dec 28, 2021
a192349
Create TypelevelPlugin
armanbilge Dec 28, 2021
8b18a86
Relocate isScala3 setting
armanbilge Dec 28, 2021
db0202b
Don't import non-existent keys
armanbilge Dec 28, 2021
d43feb5
Setup snapshot publishing?
armanbilge Dec 28, 2021
dc28ec1
Remove unused import
armanbilge Dec 28, 2021
f2510a8
Ci release plugin refactoring
armanbilge Dec 28, 2021
26fd48f
Refactoring again ...
armanbilge Dec 28, 2021
f6cc274
Regenerate workflow
armanbilge Dec 28, 2021
a57db49
Update root aggregates ...
armanbilge Dec 28, 2021
c8e95ef
Add a README
armanbilge Dec 28, 2021
51ec9a3
Shuffle some triggers
armanbilge Dec 28, 2021
5df4aff
Remove unused import
armanbilge Dec 28, 2021
8cc7e29
Update README.md
armanbilge Dec 28, 2021
52cc0db
Set version scheme in versioning plugin
armanbilge Dec 28, 2021
7424b81
Create GitHelper in kernel
armanbilge Dec 28, 2021
43dc06b
Smarter snapshot versioning, I think ...
armanbilge Dec 28, 2021
235b363
Only use tags in same history
armanbilge Dec 28, 2021
11de42f
Ignore pre-releases for versioning
armanbilge Dec 28, 2021
21c93e6
Fix version comparator
armanbilge Dec 28, 2021
f83a218
Another random setting
armanbilge Dec 29, 2021
696eebe
Setup for stable publishing
armanbilge Dec 29, 2021
6c42f5b
Hardened scm-info settings
armanbilge Dec 29, 2021
203771c
Back to true snapshots
armanbilge Dec 29, 2021
b3e236a
And back again to stable snapshots for now
armanbilge Dec 29, 2021
01e80ea
Finish up passphrase-stripping impl
armanbilge Dec 29, 2021
bedf652
Regenerate workflow
armanbilge Dec 29, 2021
775c4c8
Bikeshedding
armanbilge Dec 29, 2021
1f37022
Fix mima artifacts
armanbilge Dec 29, 2021
49d5d54
Bump back base version, woops
armanbilge Dec 29, 2021
6c3d633
Adjust version comparator for new scheme
armanbilge Dec 29, 2021
95ee54d
Clearer variable names
armanbilge Dec 29, 2021
ddf26e7
Tweak mima interpretation of current
armanbilge Dec 29, 2021
f277ca9
Update CODE_OF_CONDUCT.md
armanbilge Dec 29, 2021
53f42e4
Thin the default ci matrix
armanbilge Dec 30, 2021
00218f9
Update the developer list
armanbilge Dec 30, 2021
02972dd
Try to clarify snapshot setting
armanbilge Dec 30, 2021
2c2149a
Try out my publishing rights
armanbilge Dec 30, 2021
df43b10
Try legacy host?
armanbilge Dec 30, 2021
44d1f98
Don't use s01 by default
armanbilge Dec 30, 2021
a0c87a0
Update the main branch
armanbilge Dec 30, 2021
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
129 changes: 129 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# This file was automatically generated by sbt-github-actions using the
# githubWorkflowGenerate task. You should add and commit this file to
# your git repository. It goes without saying that you shouldn't edit
# this file by hand! Instead, if you wish to make changes, you should
# change your sbt build configuration to revise the workflow description
# to meet your needs, then regenerate this file.

name: Continuous Integration

on:
pull_request:
branches: ['**']
push:
branches: ['**']
tags: [v*]

env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.15]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 8

- name: Cache sbt
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Check that workflows are up to date
run: sbt ++${{ matrix.scala }} githubWorkflowCheck

- run: sbt ++${{ matrix.scala }} ci

- name: Compress target directories
run: tar cf targets.tar kernel/target versioning/target ci-release/target target ci-signing/target mima/target no-publish/target sonatype/target ci/target sonatype-ci-release/target core/target settings/target project/target

- name: Upload target directories
uses: actions/upload-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
path: targets.tar

publish:
name: Publish Artifacts
needs: [build]
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/armanbilge')
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.15]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 8

- name: Cache sbt
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Download target directories (2.12.15)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }}

- name: Inflate target directories (2.12.15)
run: |
tar xf targets.tar
rm targets.tar

- name: Import signing key
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
run: echo $PGP_SECRET | base64 -d | gpg --import

- name: Import signing key and strip passphrase
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
run: |
echo "$PGP_SECRET" | base64 -d > /tmp/signing-key.gpg
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
(echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)

- if: (startsWith(github.ref, 'refs/tags/v') && github.ref_type == 'tag') || (!startsWith(github.ref, 'refs/tags/v') && github.ref_type != 'tag')
run: sbt ++${{ matrix.scala }} release
59 changes: 59 additions & 0 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This file was automatically generated by sbt-github-actions using the
# githubWorkflowGenerate task. You should add and commit this file to
# your git repository. It goes without saying that you shouldn't edit
# this file by hand! Instead, if you wish to make changes, you should
# change your sbt build configuration to revise the workflow description
# to meet your needs, then regenerate this file.

name: Clean

on: push

jobs:
delete-artifacts:
name: Delete Artifacts
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Delete artifacts
run: |
# Customize those three lines with your repository and credentials:
REPO=${GITHUB_API_URL}/repos/${{ github.repository }}

# A shortcut to call GitHub API.
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; }

# A temporary file which receives HTTP response headers.
TMPFILE=/tmp/tmp.$$

# An associative array, key: artifact name, value: number of artifacts of that name.
declare -A ARTCOUNT

# Process all artifacts on this repository, loop on returned "pages".
URL=$REPO/actions/artifacts
while [[ -n "$URL" ]]; do

# Get current page, get response headers in a temporary file.
JSON=$(ghapi --dump-header $TMPFILE "$URL")

# Get URL of next page. Will be empty if we are at the last page.
URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*<//' -e 's/>.*//')
rm -f $TMPFILE

# Number of artifacts on this page:
COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') ))

# Loop on all artifacts on this page.
for ((i=0; $i < $COUNT; i++)); do

# Get name of artifact and count instances of this name.
name=$(jq <<<$JSON -r ".artifacts[$i].name?")
ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1))

id=$(jq <<<$JSON -r ".artifacts[$i].id?")
size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") ))
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size
ghapi -X DELETE $REPO/actions/artifacts/$id
done
done
32 changes: 17 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
*.class
*.log

# sbt specific
.lib/
dist/*
target/
lib_managed/
src_managed/
project/boot/
project/plugins/project/

# IDE specific
.scala_dependencies
.*.swp
.*.swo
.idea*
.sbtopts

# vim
*.sw?

# intellij
.idea/

# Ignore [ce]tags files
tags

# Metals
.metals/
.bsp/
.bloop/
metals.sbt
.vscode
63 changes: 63 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
version = 3.3.0
rossabaker marked this conversation as resolved.
Show resolved Hide resolved

runner.dialect = Scala212

maxColumn = 96

includeCurlyBraceInSelectChains = true
includeNoParensInSelectChains = true

optIn {
breakChainOnFirstMethodDot = false
forceBlankLineBeforeDocstring = true
}

binPack {
literalArgumentLists = true
parentConstructors = Never
}

danglingParentheses {
defnSite = false
callSite = false
ctrlSite = false

exclude = []
}

newlines {
beforeCurlyLambdaParams = multilineWithCaseOnly
afterCurlyLambda = squash
implicitParamListModifierPrefer = before
sometimesBeforeColonInMethodReturnType = true
}

align.preset = none
align.stripMargin = true

assumeStandardLibraryStripMargin = true

docstrings {
style = Asterisk
oneline = unfold
}

project.git = true

trailingCommas = never

rewrite {
// RedundantBraces honestly just doesn't work, otherwise I'd love to use it
rules = [PreferCurlyFors, RedundantParens, SortImports]

redundantBraces {
maxLines = 1
stringInterpolation = true
}
}

rewriteTokens {
"⇒": "=>"
"→": "->"
"←": "<-"
}
4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

14 changes: 14 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Code of Conduct

We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other such characteristics.

Everyone is expected to follow the [Scala Code of Conduct] when discussing the project on the available communication channels.

## Moderation

Any questions, concerns, or moderation requests please contact a member of the project.

- Ross A. Baker: [twitter](https://twitter.com/rossabaker) | [email](mailto:[email protected])
- Arman Bilge: [twitter](https://twitter.com/armanbilge) | [email](mailto:[email protected])

[Scala Code of Conduct]: https://typelevel.org/code-of-conduct.html
Loading