-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (78 loc) · 2.29 KB
/
sarif-utils-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
name: Create release
on:
push:
tags:
- 'v*'
branches:
- main
env:
GPG_SEC: ${{ secrets.PGP_SEC }}
GPG_PASSWORD: ${{ secrets.PGP_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.SONATYPE_USER }}
OSSRH_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
jobs:
release:
name: Build release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# release workflow should have access to all tags
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
- name: Status git before
run: git status
- name: gradle release from tag
# if workflow is triggered after push of a tag, deploy full release
if: ${{ github.ref_type == 'tag' }}
uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper
arguments: |
publishToSonatype
closeSonatypeStagingRepository
-Prelease
--build-cache
-PgprUser=${{ github.actor }}
-PgprKey=${{ secrets.GITHUB_TOKEN }}
- name: gradle snapshot from branch
# if workflow is triggered after push to a branch, deploy snapshot
if: ${{ github.ref_type == 'branch' }}
uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper
arguments: |
publishToSonatype
-Preckon.stage=snapshot
-Prelease
--build-cache
-PgprUser=${{ github.actor }}
-PgprKey=${{ secrets.GITHUB_TOKEN }}
- name: Status git after
if: ${{ always() }}
run: git status
github_release:
needs: release
# release is created only for tags
if: ${{ github.ref_type == 'tag' }}
name: Create Github Release
runs-on: ubuntu-latest
steps:
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false