-
Notifications
You must be signed in to change notification settings - Fork 63
52 lines (41 loc) · 1.85 KB
/
branch-snapshot-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
# This workflow will release project with Gradle
name: Publish binary version from branch
on:
workflow_dispatch:
inputs:
pull_request:
description: 'The suffix of the snapshot that is going to be released (i.e XXXX)'
required: true
env:
PR_NUMBER: ${{ github.event.inputs.pull_request }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: ./.github/actions/setup
- name: Release with Gradle
run: |
PR_NUMBER=PR-${{ env.PR_NUMBER }}
sed -i '/version=/ s/-SNAPSHOT/-'"$PR_NUMBER"'-SNAPSHOT/' ./gradle.properties
./gradlew clean build publishAllVersions -Pzowe.deploy.username=$ARTIFACTORY_USERNAME -Pzowe.deploy.password=$ARTIFACTORY_PASSWORD -Partifactory_user=$ARTIFACTORY_USERNAME -Partifactory_password=$ARTIFACTORY_USERNAME -PpullRequest=$PR_NUMBER
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
BRANCH_NAME: ${{ github.ref_name }}
BUILD_NUMBER: ${{ github.run_number }}
- name: Store test results
uses: actions/upload-artifact@v4
if: failure()
with:
name: BranchSnapshotRelease-${{ github.run_number }}
path: |
gateway-service/build/reports/**
discovery-service/build/reports/**
caching-service/build/reports/**
api-catalog-services/build/reports/**
zaas-service/build/reports/**
- uses: ./.github/actions/teardown