-
Notifications
You must be signed in to change notification settings - Fork 5
37 lines (31 loc) · 1.13 KB
/
binary-publish-branch.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
name: Publish branch binaries
on:
push: # run on push to any branch except master
branches-ignore:
- v1.x/master
- v2.x/master
env:
BRANCH_NAME: ${{ github.ref_name }}
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- uses: ./.github/actions/setup
- name: Set version to include branch
run: |
# Replace / and _ with - in branch name
CLEAN_BRANCH_NAME=$(echo "$BRANCH_NAME" | sed "s/\//-/g" | sed "s/_/-/g" | awk '{print toupper($0)}')
sed -i '/version=/ s/-SNAPSHOT/'-"$CLEAN_BRANCH_NAME"'-BRANCH-SNAPSHOT/g' ./gradle.properties
- name: Publish with Gradle
run: >
./gradlew packageFilesApiServer publishAllVersions
-Pdeploy.username=$ARTIFACTORY_USERNAME -Pdeploy.password=$ARTIFACTORY_PASSWORD
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
BUILD_NUMBER: ${{ github.run_number }}
- uses: ./.github/actions/teardown