Skip to content

Add Sonatype release configuration #474

Add Sonatype release configuration

Add Sonatype release configuration #474

Workflow file for this run

name: CI
on:
push:
branches:
- '*'
tags:
- 'v*'
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Coursier cache
uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
with:
jvm: adopt:8
apps: sbt scala
- name: Scalafmt
run: sbt scalafmtCheck test:scalafmtCheck
- name: Test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sbt coverage test coverageReport
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
- name: Clean up
run: |
rm -rf "$HOME/.ivy2/local" || true
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.sbt -name "*.lock" -delete || true
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
- name: Generate example schemas
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sbt generateSchemas
- name: Install ajv
run: |
yarn global add ajv-cli ajv-formats
yarn global bin >> $GITHUB_PATH
- name: Validate generated schema
run: |
for schema in target/jsonoid-schemas/*.json; do
ajv compile --spec=draft2020 -s $schema -c ajv-formats
done
publish-package:
if: ${{ github.event_name != 'pull_request' }}
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Coursier cache
uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
with:
jvm: adopt:8
apps: sbt scala
- name: Publish package
env:
DISABLE_ASSERTIONS: 1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sbt publishSigned
run: RELEASE_SONATYPE=true sbt publishSigned

Check failure on line 75 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yml (Line: 75, Col: 7): 'run' is already defined
publish-site:
if: ${{ github.event_name != 'pull_request' }}
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Coursier cache
uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
with:
jvm: adopt:8
apps: sbt scala
- name: Publish site
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
sbt makeSite
sbt generateSchemas
cp target/jsonoid-schemas/*.json target/site/schemas
sbt publishToGitHubPages