Skip to content

Commit

Permalink
Merge branch 'main' into update/sbt-1.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge authored Jan 7, 2023
2 parents 68d9884 + 9904f04 commit aec7613
Show file tree
Hide file tree
Showing 42 changed files with 1,161 additions and 580 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{scala,sbt}]
indent_style = space
indent_size = 2
222 changes: 174 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@ on:
tags: [v*]

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


concurrency:
group: ${{ github.workflow }} @ ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.17]
java: [temurin@8, temurin@17]
project: [rootJVM]
scala: [2.12]
java: [temurin@8, temurin@17, graal_latest@17]
project: [sbt-typelevelJVM]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
Expand All @@ -47,12 +48,18 @@ jobs:
java-version: 8

- name: Setup Java (temurin@8)
id: setup-java-temurin-8
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 8
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' reload +update

- name: Download Java (temurin@17)
id: download-java-temurin-17
Expand All @@ -63,24 +70,31 @@ jobs:
java-version: 17

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' reload +update

- name: Cache sbt
uses: actions/cache@v3
- name: Setup GraalVM (graal_latest@17)
id: setup-graalvm-latest-17
if: matrix.java == 'graal_latest@17'
uses: graalvm/setup-graalvm@v1
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') }}
version: latest
java-version: 17
cache: sbt

- name: sbt update
if: matrix.java == 'graal_latest@17' && steps.setup-graalvm-latest-17.outputs.cache-hit == 'false'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' reload +update

- name: Check that workflows are up to date
run: sbt githubWorkflowCheck
Expand All @@ -105,15 +119,15 @@ jobs:
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/0.4')
run: mkdir -p github/target github-actions/target kernel/target versioning/target ci-release/target scalafix/target target .js/target mdocs/target site/target ci-signing/target mergify/target unidoc/target mima/target .jvm/target .native/target no-publish/target sonatype/target ci/target sonatype-ci-release/target core/target settings/target project/target
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: mkdir -p github/target github-actions/target kernel/target versioning/target ci-release/target scalafix/target .jvm/target mdocs/target site/target ci-signing/target mergify/target unidoc/target .native/target mima/target no-publish/target sonatype/target ci/target sonatype-ci-release/target core/target settings/target target .js/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/0.4')
run: tar cf targets.tar github/target github-actions/target kernel/target versioning/target ci-release/target scalafix/target target .js/target mdocs/target site/target ci-signing/target mergify/target unidoc/target mima/target .jvm/target .native/target no-publish/target sonatype/target ci/target sonatype-ci-release/target core/target settings/target project/target
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: tar cf targets.tar github/target github-actions/target kernel/target versioning/target ci-release/target scalafix/target .jvm/target mdocs/target site/target ci-signing/target mergify/target unidoc/target .native/target mima/target no-publish/target sonatype/target ci/target sonatype-ci-release/target core/target settings/target target .js/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/0.4')
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
uses: actions/upload-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }}
Expand All @@ -122,13 +136,14 @@ jobs:
publish:
name: Publish Artifacts
needs: [build]
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/0.4')
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.17]
java: [temurin@8]
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
Expand All @@ -144,12 +159,18 @@ jobs:
java-version: 8

- name: Setup Java (temurin@8)
id: setup-java-temurin-8
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 8
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
run: sbt '++ ${{ matrix.scala }}' reload +update

- name: Download Java (temurin@17)
id: download-java-temurin-17
Expand All @@ -160,49 +181,141 @@ jobs:
java-version: 17

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt '++ ${{ matrix.scala }}' reload +update

- name: Cache sbt
uses: actions/cache@v3
- name: Setup GraalVM (graal_latest@17)
id: setup-graalvm-latest-17
if: matrix.java == 'graal_latest@17'
uses: graalvm/setup-graalvm@v1
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.17, rootJVM)
version: latest
java-version: 17
cache: sbt

- name: sbt update
if: matrix.java == 'graal_latest@17' && steps.setup-graalvm-latest-17.outputs.cache-hit == 'false'
run: sbt '++ ${{ matrix.scala }}' reload +update

- name: Download target directories (2.12, sbt-typelevelJVM)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootJVM
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-sbt-typelevelJVM

- name: Inflate target directories (2.12.17, rootJVM)
- name: Inflate target directories (2.12, sbt-typelevelJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Import signing key
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: echo $PGP_SECRET | base64 -di | gpg --import

- name: Import signing key and strip passphrase
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: |
echo "$PGP_SECRET" | base64 -di > /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)
- name: Publish
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
run: sbt '++ ${{ matrix.scala }}' tlRelease

dependency-submission:
name: Submit Dependencies
if: github.event_name != 'pull_request'
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.17]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download Java (temurin@8)
id: download-java-temurin-8
if: matrix.java == 'temurin@8'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 8

- name: Setup Java (temurin@8)
id: setup-java-temurin-8
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 8
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
run: sbt '++ ${{ matrix.scala }}' reload +update

- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt '++ ${{ matrix.scala }}' reload +update

- name: Setup GraalVM (graal_latest@17)
id: setup-graalvm-latest-17
if: matrix.java == 'graal_latest@17'
uses: graalvm/setup-graalvm@v1
with:
version: latest
java-version: 17
cache: sbt

- name: sbt update
if: matrix.java == 'graal_latest@17' && steps.setup-graalvm-latest-17.outputs.cache-hit == 'false'
run: sbt '++ ${{ matrix.scala }}' reload +update

- name: Submit Dependencies
uses: scalacenter/sbt-dependency-submission@v2

site:
name: Generate Site
strategy:
Expand All @@ -226,12 +339,18 @@ jobs:
java-version: 8

- name: Setup Java (temurin@8)
id: setup-java-temurin-8
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 8
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
run: sbt '++ ${{ matrix.scala }}' reload +update

- name: Download Java (temurin@17)
id: download-java-temurin-17
Expand All @@ -242,24 +361,31 @@ jobs:
java-version: 17

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt '++ ${{ matrix.scala }}' reload +update

- name: Cache sbt
uses: actions/cache@v3
- name: Setup GraalVM (graal_latest@17)
id: setup-graalvm-latest-17
if: matrix.java == 'graal_latest@17'
uses: graalvm/setup-graalvm@v1
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') }}
version: latest
java-version: 17
cache: sbt

- name: sbt update
if: matrix.java == 'graal_latest@17' && steps.setup-graalvm-latest-17.outputs.cache-hit == 'false'
run: sbt '++ ${{ matrix.scala }}' reload +update

- name: Generate site
run: sbt '++ ${{ matrix.scala }}' docs/tlSite
Expand Down
5 changes: 3 additions & 2 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ pull_request_rules:
- or:
- body~=labels:.*early-semver-patch
- body~=labels:.*early-semver-minor
- status-success=Build and Test (ubuntu-latest, 2.12.17, temurin@8, rootJVM)
- status-success=Build and Test (ubuntu-latest, 2.12.17, temurin@17, rootJVM)
- status-success=Build and Test (ubuntu-latest, 2.12, temurin@8, sbt-typelevelJVM)
- status-success=Build and Test (ubuntu-latest, 2.12, temurin@17, sbt-typelevelJVM)
- status-success=Build and Test (ubuntu-latest, 2.12, graal_latest@17, sbt-typelevelJVM)
- '#approved-reviews-by>=1'
actions:
merge: {}
Expand Down
Loading

0 comments on commit aec7613

Please sign in to comment.