Skip to content

Merge pull request #3716 from kitbellew/3713 #1558

Merge pull request #3716 from kitbellew/3713

Merge pull request #3716 from kitbellew/3713 #1558

Workflow file for this run

name: Release
on:
push:
branches: [main]
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- 'JVM'
- 'JS'
- 'Native'
isSematicdbReleased:
- ${{ contains(github.ref, 'semanticdb') }}
exclude:
- isSematicdbReleased: true
platform: 'JS'
- isSematicdbReleased: true
platform: 'Native'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v14
- name: Set up JVM
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: 'sbt'
- name: Publish
run: |
COMMAND="ci-release"
if [[ $GITHUB_REF == "refs/tags"* ]] && [[ $GITHUB_REF_NAME == "semanticdb_v"* ]]; then
VERSION=$(echo $GITHUB_REF_NAME | cut -d "_" -f2 | cut -c2-)
SCALA_VERSION=$(echo $GITHUB_REF_NAME | cut -d "_" -f3)
if [ ! -z $VERSION ] && [ ! -z $SCALA_VERSION ]; then
export CI_RELEASE="++$SCALA_VERSION semanticdbScalacCore/publishSigned; ++$SCALA_VERSION semanticdbScalacPlugin/publishSigned; ++$SCALA_VERSION metac/publishSigned"
COMMAND="; set ThisBuild/version :=\"$VERSION\"; $COMMAND"
else
echo 'Invalid tag name. Expected: semanticdb_v${existing-release}_${scala-version}'
exit 1
fi
fi
sbt "$COMMAND"
env:
SCALAMETA_PLATFORM: ${{ matrix.platform }}
GIT_USER: scalameta@scalameta.org
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
GITHUB_DEPLOY_KEY: ${{ secrets.GITHUB_DEPLOY_KEY }}
GOOGLE_APPLICATION_CREDENTIALS:
${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
GOOGLE_APPLICATION_CREDENTIALS_JSON:
${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }}