-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.27 KB
/
release.yml
File metadata and controls
57 lines (47 loc) · 1.27 KB
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
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
release:
name: Build and release
runs-on: ubuntu-latest
steps:
- name: Checkout tagged commit
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate tag format
shell: bash
run: |
if [[ ! "$GITHUB_REF_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Tag must match vMAJOR.MINOR.PATCH, for example v1.0.0."
exit 1
fi
- name: Verify tag is on main
shell: bash
run: |
git fetch origin main
if ! git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then
echo "Release tag must point to a commit included in main."
exit 1
fi
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: "9.2.1"
- name: Build
run: gradle build
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: build/libs/Jetpack.jar
generate_release_notes: true