-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (81 loc) · 2.64 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Publish package to Maven Central and PIP
on:
release:
types: [created]
jobs:
publishJvmOnMavenCentral:
runs-on: ubuntu-latest
if: github.event_name == 'release' && contains(github.ref, 'ruleofthumb')
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
if: github.event_name == 'release' && contains(github.ref, 'ruleofthumb')
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 }}