Skip to content

Publish package to Maven Central and PIP #11

Publish package to Maven Central and PIP

Publish package to Maven Central and PIP #11

Workflow file for this run

name: Publish package to Maven Central and PIP
on:
workflow_dispatch:
jobs:
publishJvmOnMavenCentral:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- scala-version: 2.12.11
spark-version: 3.0.0
- scala-version: 2.12.11
spark-version: 3.1.2
- scala-version: 2.12.11
spark-version: 3.2.0
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Perform build
env:
SCALA_VERSION: ${{ matrix.scala-version }}
SPARK_VERSION: ${{ matrix.spark-version }}
run: ./gradlew :ruleofthumb:build :ruleofthumb:publishToMavenLocal -PscalaVersion=$SCALA_VERSION -PsparkVersion=$SPARK_VERSION
- name: Release to Maven Central
run: ./gradlew :ruleofthumb:publishToSonatype closeAndReleaseStagingRepository -i -PscalaVersion=$SCALA_VERSION -PsparkVersion=$SPARK_VERSION
env:
SCALA_VERSION: ${{ matrix.scala-version }}
SPARK_VERSION: ${{ matrix.spark-version }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PWD: ${{ secrets.SONATYPE_PWD }}
PGP_KEY: ${{ secrets.PGP_KEY }}
PGP_PWD: ${{ secrets.PGP_PWD }}
publishPython:
needs: publishJvmOnMavenCentral
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
python/
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}