-
Notifications
You must be signed in to change notification settings - Fork 3
136 lines (118 loc) · 4.24 KB
/
release-pipeline.yaml
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: RET Plugin release pipeline
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
next:
description: 'Next version to release'
required: true
env:
GRAAL_VERSION: '22.3.0'
JAVA_VERSION: '19'
JAVA_DISTRO: 'zulu'
jobs:
# Set versions
prepare:
runs-on: ubuntu-latest
steps:
- name: Retrieve tag exists flag
uses: mukunku/[email protected]
id: checkTag
with:
tag: ${{ github.event.inputs.version }}
- uses: actions/checkout@v4
if: steps.checkTag.outputs.exists == 'false'
with:
persist-credentials: false
fetch-depth: 0
- name: 'Set up Java'
if: steps.checkTag.outputs.exists == 'false'
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}
- name: 'Configure Git user'
if: steps.checkTag.outputs.exists == 'false'
run: |
git config --global user.email "[email protected]"
git config --global user.name "Skunk Works Rabot"
- name: 'Prepare release'
if: steps.checkTag.outputs.exists == 'false'
run: |
RELEASE_VERSION=${{ github.event.inputs.version }}
NEXT_VERSION=${{ github.event.inputs.next }}
mvn -B -ntp release:prepare -B -Dusername=skunkworks-rabot -Dpassword=${{ secrets.SKUNKWORKS_RABOT_PAT}} -Dtag=$RELEASE_VERSION -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion="${NEXT_VERSION}-SNAPSHOT"
# Build plugins per runner
cli:
needs: [ prepare ]
name: 'Build plugins with Graal on ${{ matrix.os }}'
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, macOS-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: 'Check out repository'
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.version }}
fetch-depth: 0
- name: 'Set up Graal'
uses: graalvm/setup-graalvm@v1
with:
version: ${{ env.GRAAL_VERSION }}
java-version: ${{ env.JAVA_VERSION }}
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Cache Maven packages'
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: 'Build Native Image'
run: mvn -B -ntp -Pnative-plugin package
- name: 'Upload build artifact'
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
git-plugin/target/distributions/*.zip
git-plugin/target/distributions/*.alfredworkflow
splunk-plugin/target/distributions/*.zip
splunk-plugin/target/distributions/*.alfredworkflow
# Collect all release candidates and release
release:
needs: [ cli ]
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@v4
with:
fetch-depth: 0 # otherwise, pushing refs to dest repo fails
- name: 'Checkout tag'
run: |
git fetch --all
git checkout --progress --force refs/tags/${{ github.event.inputs.version }}
- name: 'Download all build artifacts'
uses: actions/download-artifact@v3
- name: 'Set up Java'
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}
- name: 'Cache Maven packages'
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: 'Release with JReleaser'
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.SKUNKWORKS_RABOT_PAT }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
run: mvn -N -B -ntp -DartifactsDir=artifacts jreleaser:full-release