Skip to content

refined4s v1.0.0

refined4s v1.0.0 #265

Workflow file for this run

name: Release
on:
push:
branches:
- main
tags:
- '*'
env:
GH_JAVA_VERSION: "11"
GH_JAVA_DISTRIBUTION: "temurin"
GH_SBT_OPTS: "-Xss64m -Xms1024m -Xmx8G -XX:MaxMetaspaceSize=2G -XX:-UseGCOverheadLimit -XX:MaxInlineLevel=18 -XX:+UnlockExperimentalVMOptions"
GH_JVM_OPTS: "-Xss64m -Xms1024m -Xmx8G -XX:MaxMetaspaceSize=2G -XX:-UseGCOverheadLimit -XX:MaxInlineLevel=18 -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
scala:
- { name: "Scala 3", version: "3.3.3", binary-version: "3", java-version: "11", java-distribution: "temurin", report: "" }
steps:
- uses: actions/[email protected]
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.scala.java-version }}
distribution: ${{ matrix.scala.java-distribution }}
- name: Cache SBT
uses: actions/[email protected]
with:
path: |
~/.ivy2/cache
~/.cache/coursier
~/.sbt
key: ${{ runner.os }}-sbt-${{ matrix.scala.binary-version }}-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }}
restore-keys: |
${{ runner.os }}-sbt-${{ matrix.scala.binary-version }}-
- name: "[Push] Build All for ${{ matrix.scala.name }} ${{ matrix.scala.version }} - ${{ github.run_number }}"
if: github.event_name == 'push'
env:
CURRENT_BRANCH_NAME: ${{ github.ref }}
RUN_ID: ${{ github.run_id }}
RUN_NUMBER: ${{ github.run_number }}
JVM_OPTS: ${{ env.GH_JVM_OPTS }}
SBT_OPTS: ${{ env.GH_SBT_OPTS }}
run: |
echo "[BEFORE]CURRENT_BRANCH_NAME=${CURRENT_BRANCH_NAME}"
export CURRENT_BRANCH_NAME="${CURRENT_BRANCH_NAME#refs/heads/}"
echo " [AFTER]CURRENT_BRANCH_NAME=${CURRENT_BRANCH_NAME}"
echo "RUN_ID=${RUN_ID}"
echo "RUN_NUMBER=${RUN_NUMBER}"
echo "Push #${PUSH_NUMBER}"
echo "JVM_OPTS=${JVM_OPTS}"
echo "SBT_OPTS=${SBT_OPTS}"
java -version
sbt \
++${{ matrix.scala.version }}! \
-v \
clean \
test
test_report:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
strategy:
matrix:
scala:
- { name: "Scala 3", version: "3.3.3", binary-version: "3", java-version: "11", java-distribution: "temurin", report: "report" }
steps:
- uses: actions/[email protected]
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.scala.java-version }}
distribution: ${{ matrix.scala.java-distribution }}
- name: Cache SBT
uses: actions/[email protected]
with:
path: |
~/.ivy2/cache
~/.cache/coursier
~/.sbt
key: ${{ runner.os }}-sbt-${{ matrix.scala.binary-version }}-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }}
restore-keys: |
${{ runner.os }}-sbt-${{ matrix.scala.binary-version }}-
- name: "[Codecov] Report ${{ matrix.scala.name }} ${{ matrix.scala.version }} - ${{ github.run_number }}"
if: ${{ matrix.scala.report == 'report' }}
env:
CURRENT_BRANCH_NAME: ${{ github.ref }}
RUN_ID: ${{ github.run_id }}
RUN_NUMBER: ${{ github.run_number }}
JVM_OPTS: ${{ env.GH_JVM_OPTS }}
SBT_OPTS: ${{ env.GH_SBT_OPTS }}
run: |
echo "[BEFORE]CURRENT_BRANCH_NAME=${CURRENT_BRANCH_NAME}"
export CURRENT_BRANCH_NAME="${CURRENT_BRANCH_NAME#refs/heads/}"
echo " [AFTER]CURRENT_BRANCH_NAME=${CURRENT_BRANCH_NAME}"
echo "RUN_ID=${RUN_ID}"
echo "RUN_NUMBER=${RUN_NUMBER}"
.github/workflows/sbt-build-all.sh ${{ matrix.scala.version }} ${{ matrix.scala.report }}
- if: ${{ matrix.scala.report == 'report' }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
gh-release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-java@v4
with:
java-version: ${{ env.GH_JAVA_VERSION }}
distribution: ${{ env.GH_JAVA_DISTRIBUTION }}
- name: Cache SBT
uses: actions/[email protected]
with:
path: |
~/.ivy2/cache
~/.cache/coursier
~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }}
restore-keys: |
${{ runner.os }}-sbt
- name: sbt GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_AUTH_TOKEN_GITHUB }}
JVM_OPTS: ${{ env.GH_JVM_OPTS }}
SBT_OPTS: ${{ env.GH_SBT_OPTS }}
run: |
echo "Run] sbt GitHub release"
echo "JVM_OPTS=${JVM_OPTS}"
echo "SBT_OPTS=${SBT_OPTS}"
echo 'sbt devOopsGitHubRelease'
sbt \
devOopsGitHubRelease
publish:
needs: gh-release
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: ${{ env.GH_JAVA_VERSION }}
distribution: ${{ env.GH_JAVA_DISTRIBUTION }}
- uses: olafurpg/setup-gpg@v3
- name: Cache SBT
uses: actions/[email protected]
with:
path: |
~/.ivy2/cache
~/.cache/coursier
~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }}
restore-keys: |
${{ runner.os }}-sbt
- name: "sbt ci-release - ${{ github.run_number }}"
if: startsWith(github.ref, 'refs/tags/v')
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
GITHUB_TOKEN: ${{ secrets.RELEASE_AUTH_TOKEN_GITHUB }}
JVM_OPTS: ${{ env.GH_JVM_OPTS }}
SBT_OPTS: ${{ env.GH_SBT_OPTS }}
run: |
echo "Run] sbt ci-release"
export SOURCE_DATE_EPOCH=$(date +%s)
echo "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH"
echo "JVM_OPTS=${JVM_OPTS}"
echo "SBT_OPTS=${SBT_OPTS}"
echo 'sbt -v clean +packagedArtifacts ci-release'
sbt \
-v \
clean \
+packagedArtifacts \
ci-release
publish-snapshot:
needs: build
if: startsWith(github.ref, 'refs/heads/')
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: ${{ env.GH_JAVA_VERSION }}
distribution: ${{ env.GH_JAVA_DISTRIBUTION }}
- uses: olafurpg/setup-gpg@v3
- name: Cache SBT
uses: actions/[email protected]
with:
path: |
~/.ivy2/cache
~/.cache/coursier
~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }}
restore-keys: |
${{ runner.os }}-sbt
- name: "sbt ci-release (no tag) - ${{ github.run_number }}"
if: startsWith(github.ref, 'refs/heads/')
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
JVM_OPTS: ${{ env.GH_JVM_OPTS }}
SBT_OPTS: ${{ env.GH_SBT_OPTS }}
run: |
echo "Run] sbt ci-release"
export SOURCE_DATE_EPOCH=$(date +%s)
echo "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH"
echo "JVM_OPTS=${JVM_OPTS}"
echo "SBT_OPTS=${SBT_OPTS}"
echo 'sbt -v clean +packagedArtifacts ci-release'
sbt \
-v \
clean \
+packagedArtifacts \
ci-release