-
Notifications
You must be signed in to change notification settings - Fork 45
92 lines (87 loc) · 2.85 KB
/
publish-release.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
82
83
84
85
86
87
88
89
90
91
92
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
#
# Notes:
# - we need to install pypandoc first as it is needed by pyspark setup
# - using python 3.7 because platform specific wheel for pandas 0.23.x required
# by hail is not available for python 3.8
#
name: Publish Release
on:
push:
tags:
- 'v**'
jobs:
deploy:
name: Deploy to Maven Central and PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Cache Python packages
uses: actions/cache@v2
id: pythoncache
with:
path: /home/runner/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('dev/dev-requirements.txt') }}
restore-keys: ${{ runner.os }}-pip
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip cache dir
pip install pypandoc==1.5 setuptools wheel twine
if [ -f dev/dev-requirements.txt ]; then pip install -r dev/dev-requirements.txt; fi
- name: Install GPG key
run: |
cat <(echo -e "${{ secrets.GPG_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Configure Maven settings
uses: s4u/[email protected]
with:
servers: |
[{
"id": "ossrh",
"username": "${{ secrets.OSSRH_USERNAME }}",
"password": "${{ secrets.OSSRH_PASSWORD }}"
}]
- name: Build with Maven
run: |
mvn -Prelease -DskipTests=true -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" \
--batch-mode --file pom.xml \
deploy
- name: Build and publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
cd python
python setup.py sdist bdist_wheel
twine upload dist/*
create-release:
name: Draft GitHub release
runs-on: ubuntu-latest
needs: [ deploy ]
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: true