Publish Package on Release #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Package on Release | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'adopt' | |
java-version: '11' | |
- name: Cache sbt | |
uses: actions/cache@v2 | |
with: | |
path: ~/.sbt | |
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }} | |
restore-keys: | | |
${{ runner.os }}-sbt- | |
- name: Cache Coursier | |
uses: actions/cache@v2 | |
with: | |
path: ~/.coursier | |
key: ${{ runner.os }}-coursier-${{ hashFiles('**/build.sbt') }} | |
restore-keys: | | |
${{ runner.os }}-coursier- | |
- name: Setup sbt credentials | |
run: | | |
mkdir -p ~/.sbt/1.0 | |
echo "credentials += Credentials(\"GitHub Package Registry\", \"maven.pkg.github.com\", \"${{ github.actor }}\", \"${{ secrets.GITHUB_TOKEN }}\")" >> ~/.sbt/1.0/global.sbt | |
- name: Build and publish for Scala 2.13 | |
run: | | |
sbt ++2.13.12 clean compile publishM2 | |
sbt ++2.13.12 publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and publish for Scala 3 | |
run: | | |
sbt ++3.3.0 clean compile publishM2 | |
sbt ++3.3.0 publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |