-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (54 loc) · 1.91 KB
/
publish.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
name: Publish to artifactory on release branch
on:
push:
branches: [ "release" ]
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
permissions:
contents: write # needed for tagging and creating release
id-token: write
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
steps:
- name: "Setup Java"
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: "Checkout sources"
uses: actions/checkout@v4
- name: Expose version for creating release
run: ./gradlew -v && echo "VERSION=$( ./gradlew :getVersion --no-configuration-cache | tail -n1)" >> $GITHUB_ENV
#run: echo "VERSION=1.1.1" >> $GITHUB_ENV
- name: Create tag
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ env.VERSION }}',
sha: context.sha
})
- name: release
uses: actions/create-release@v1
id: create_release
with:
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ env.VERSION }}
body: "Release ${{ env.VERSION }}"
env:
GITHUB_TOKEN: ${{ github.token }}
# Populates ARTIFACTORY_USERNAME and ARTIFACTORY_API_KEY with
# temporary username/password for publishing to packages.atlassian.com
- name: Get publish token
id: publish-token
uses: atlassian-labs/[email protected]
with:
output-modes: environment
# Publishes to Artifactory only on push to the "release" branch.
#- name: "Publish"
# run: ./gradlew assemble --no-configuration-cache && ./gradlew publish --no-configuration-cache --stacktrace