-
Notifications
You must be signed in to change notification settings - Fork 81
43 lines (41 loc) · 1.58 KB
/
create_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
---
name: create_release
# We create a release version on a trigger tag, regardless of if the commit is
# documentation-only.
on: # yamllint disable-line rule:truthy
push:
tags: # e.g. release-1.2.3
- 'release-[0-9]+.[0-9]+.[0-9]+**'
jobs:
create_release:
runs-on: ubuntu-24.04 # newest available distribution, aka noble
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
# Prevent use of implicit GitHub Actions read-only GITHUB_TOKEN
# because maven-release-plugin pushes commits to master.
token: ${{ secrets.GH_TOKEN }}
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'zulu' # zulu as it supports a wide version range
java-version: '17' # until Spark 4 per SPARK-43831
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-jdk-17-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-jdk-17-maven-
- name: Create Release
env:
# GH_USER=<user that created GH_TOKEN>
GH_USER: ${{ secrets.GH_USER }}
# GH_TOKEN=<hex token value>
# * makes release commits and tags
# * needs repo:status, public_repo
# * referenced in .settings.xml
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: | # GITHUB_REF will be refs/tags/release-MAJOR.MINOR.PATCH
build-bin/git/login_git &&
build-bin/maven/maven_release $(echo ${GITHUB_REF} | cut -d/ -f 3)