Skip to content

Commit

Permalink
attempt 1
Browse files Browse the repository at this point in the history
  • Loading branch information
kovstas committed Jan 28, 2025
1 parent 4597b46 commit 8bd4c8a
Showing 1 changed file with 20 additions and 104 deletions.
124 changes: 20 additions & 104 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,17 @@ jobs:
with:
fetch-depth: 0

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v4
- name: Setup Scala and sbt
uses: olafurpg/setup-scala@v13
with:
distribution: temurin
java-version: 17
cache: sbt

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

- name: Install brew formulae (ubuntu)
if: (matrix.project == 'rootNative') && startsWith(matrix.os, 'ubuntu')
run: /home/linuxbrew/.linuxbrew/bin/brew install openssl s2n

- name: Check headers and formatting
if: matrix.java == 'temurin@17'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck

- name: scalaJSLink
Expand Down Expand Up @@ -75,6 +67,7 @@ jobs:
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }}
path: targets.tar
key: ${{ runner.os }}-target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }}

publish:
name: Publish Artifacts
needs: [ build ]
Expand All @@ -90,104 +83,27 @@ jobs:
with:
fetch-depth: 0

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: sbt

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

- name: Download target directories (3.3, rootJS)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.3-rootJS

- name: Inflate target directories (3.3, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.3, root)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.3-root

- name: Inflate target directories (3.3, root)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.3, rootNative)
uses: actions/download-artifact@v4
- name: Setup Scala and sbt
uses: olafurpg/setup-scala@v13
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.3-rootNative
java-version: ${{ matrix.java }}
scala-version: 3.3 # Use the latest Scala version for publishing

- name: Inflate target directories (3.3, rootNative)
- name: Download and inflate target directories
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.12, rootJS)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJS

- name: Inflate target directories (2.12, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.12, root)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-root
for version in 3.3 2.12 2.13; do
for project in rootJS root rootNative; do
if [ -f "target-${{ matrix.os }}-${{ matrix.java }}-$version-$project.tar" ]; then
tar xf "target-${{ matrix.os }}-${{ matrix.java }}-$version-$project.tar"
rm "target-${{ matrix.os }}-${{ matrix.java }}-$version-$project.tar"
fi
done
done
- name: Inflate target directories (2.12, root)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.12, rootNative)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootNative

- name: Inflate target directories (2.12, rootNative)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13, rootJS)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJS

- name: Inflate target directories (2.13, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13, root)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-root

- name: Inflate target directories (2.13, root)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13, rootNative)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootNative

- name: Inflate target directories (2.13, rootNative)
run: |
tar xf targets.tar
rm targets.tar
- name: Publish
run: sbt '++ ${{ matrix.scala }}' ci-release
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

0 comments on commit 8bd4c8a

Please sign in to comment.