-
Notifications
You must be signed in to change notification settings - Fork 110
99 lines (86 loc) · 2.95 KB
/
staging-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
93
94
95
96
97
98
99
name: Push to staging repositories
on:
workflow_dispatch:
inputs:
release-tag:
description: "Git tag for release"
required: true
spark-version:
description: "Spark version to build against"
default: "3.5.1"
scala-version:
description: "Scala version to use when building Glow"
default: "2.12.19"
java-version:
description: "Java version to use when building Glow"
default: "8"
push-python:
description: "If true, Python artifacts will be pushed to Test PyPI"
type: boolean
default: true
jobs:
push-to-staging:
runs-on: ubuntu-latest
environment: Staging
permissions:
id-token: write # Necessary to fetch a token for PyPI publishing
defaults:
run:
shell: bash -el {0}
env:
SPARK_VERSION: ${{ inputs.spark-version }}
SCALA_VERSION: ${{ inputs.scala-version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: refs/tags/${{ inputs.release-tag }}
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: ${{ inputs.java-version }}
- name: Install Conda
uses: conda-incubator/setup-miniconda@v3
with:
conda-solver: libmamba
environment-file: python/environment.yml
activate-environment: glow
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Set Sonatype credentials
run: |
cat <<EOF >>sonatype.sbt
credentials += Credentials("Sonatype Nexus Repository Manager",
"oss.sonatype.org",
"${{ secrets.SONATYPE_USERNAME }}",
"${{ secrets.SONATYPE_PASSWORD }}")
EOF
- name: Install correct PySpark version
run: pip install pyspark==${{ inputs.spark-version }}
- name: Run tests
run: sbt clean core/checkNoSnapshotDependencies core/test python/test docs/test exit
- name: Push Scala artifacts
run: sbt publishSigned sonatypePrepare sonatypeBundleUpload sonatypeClose exit
- name: Test staged artifact
run: sbt stagedRelease/test exit
- name: Build whl, sdist, and assembly jar
run: |
bin/build --scala --python
(cd python && python setup.py sdist)
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ inputs.push-python }}
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: python/dist/
- name: Upload whl and assembly jar
uses: actions/upload-artifact@v4
with:
name: binaries-${{ github.job }}
path: |
core/target/**/glow*assembly*.jar
python/dist/*.whl