-
Notifications
You must be signed in to change notification settings - Fork 4
119 lines (100 loc) · 3.59 KB
/
release.yml
File metadata and controls
119 lines (100 loc) · 3.59 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
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
name: Release
on:
workflow_dispatch:
inputs:
release_version:
description: 'Release version (e.g. 3.2.3)'
required: true
next_snapshot:
description: 'Next snapshot version (e.g. 3.2.4) without the "-SNAPSHOT" word'
required: true
defaults:
run:
shell: bash
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # needed to push tags and commits
env:
DB_URL: "//localhost:1521/FREEPDB1"
services:
oracle:
image: gvenzl/oracle-free:23-slim-faststart
env:
ORACLE_PASSWORD: oracle
SERVICE_NAME: FREEPDB1
ports:
- 1521:1521
options: >-
--health-cmd healthcheck.sh
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # full history needed for tagging
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install utPLSQL
run: sh ${{ github.workspace }}/scripts/1_install_utplsql.sh
- name: Install demo project
run: sh ${{ github.workspace }}/scripts/2_install_demo_project.sh
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set release version
run: |
mvn versions:set -DnewVersion=${{ inputs.release_version }} -DgenerateBackupPoms=false
- name: Build and test release
run: mvn clean verify -Prelease
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Deploy to Maven Central / Nexus
if: success()
run: mvn deploy -Prelease --no-transfer-progress -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Commit and tag release version
run: |
git add -u
git commit -m "chore(release): release ${{ inputs.release_version }} [skip ci]"
git tag -a "v${{ inputs.release_version }}" -m "Release ${{ inputs.release_version }}"
- name: Set next snapshot version
run: |
mvn versions:set -DnewVersion=${{ inputs.next_snapshot }}-SNAPSHOT -DgenerateBackupPoms=false
- name: Commit next snapshot version
run: |
git add -u
git commit -m "chore(release): bump to ${{ inputs.next_snapshot }}-SNAPSHOT [skip ci]"
- name: Push commits and tag
run: |
git push origin HEAD:${{ github.ref_name }}
git push origin "v${{ inputs.release_version }}"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ inputs.release_version }}"
name: "Release ${{ inputs.release_version }}"
generate_release_notes: true