-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (67 loc) · 2.21 KB
/
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
name: Publish new version
on:
workflow_dispatch:
inputs:
bump_type:
description: The type of version bump
required: true
default: patch
type: choice
options:
- major
- minor
- patch
jobs:
publish-scala:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: temurin
# TODO: Support more versions?
java-version: 11
- uses: actions/setup-python@v4
with:
python-version: "3.10.1"
- name: Cache SBT
uses: actions/cache@v3
with:
path: |
~/.ivy2/cache
~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
- name: Set the new version number
run: |
python scripts/bump_version.py -t ${{ github.event.inputs.bump_type }} -e scala
- name: Get the new version number
id: version
run: |
echo "::set-output name=jar_version::$(cat scala/VERSION)"
- name: Build artifact
run: |
sbt package
working-directory: scala
- name: Push updated version file
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add scala/VERSION
git commit -m "Release version ${{ steps.version.outputs.jar_version }}"
git push
- name: Create tag
run: |
tag=v${{ steps.version.outputs.jar_version }}
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git tag -a "${tag}" -m "Release version ${{ steps.version.outputs.jar_version }}"
git push origin "${tag}"
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.version.outputs.jar_version }}
files: |
LICENSE
scala/target/scala-2.12/spark-pit_2.12-${{ steps.version.outputs.jar_version }}.jar