-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
77 lines (72 loc) · 2.72 KB
/
action.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
65
66
67
68
69
70
71
72
73
74
75
76
77
name: 'Release Bonita connector'
description: 'This action is used to create a new release for a Bonita connector (& actor filter). It first creates a changelog based on the commits of the release, then it creates a Github release, built it and publish it on the nexus, and finally attached the built artifact to the release.'
inputs:
release-version:
description: 'The version to release.'
required: true
github-token:
description: The github token provided by Actions (you do not need to create your own token)
required: true
gpg_private_key:
description: GPG private key for signing the published artifacts
required: true
gpg_passphrase:
description: Passphrase for the GPG key
required: true
nexus_username:
description: Username (not email!) for your Nexus repository manager account
required: true
nexus_password:
description: Password for your Nexus account
required: true
build-and-release-command-line:
description: The command-line used to build and publish the release
required: false
default: ./mvnw --batch-mode deploy -Pdeploy
asset-path:
description: The path of the folder containing the built asset to attach to the release
required: false
default: ./target
asset-name:
description: The name of the file containing the built asset to attach to the release
required: false
runs:
using: "composite"
steps:
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: maven
server-id: ossrh
gpg-passphrase: GPG_PASSPHRASE
gpg-private-key: ${{ inputs.gpg_private_key }}
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- uses: scottbrenner/generate-changelog-action@master
id: Changelog
env:
REPO: ${{ github.repository }}
- run: ${{ inputs.build-and-release-command-line }}
shell: bash
env:
GPG_PASSPHRASE: ${{ inputs.gpg_passphrase }}
MAVEN_USERNAME: ${{ inputs.nexus_username }}
MAVEN_PASSWORD: ${{ inputs.nexus_password }}
- run: |
if [ "$ASSET_NAME" == "" ]; then
echo "name=${{ github.event.repository.name }}-${{ inputs.release-version }}-all.zip" >> $GITHUB_OUTPUT
else
echo "name=$(echo $ASSET_NAME)" >> $GITHUB_OUTPUT
fi
shell: bash
env:
ASSET_NAME: ${{ inputs.asset-name }}
id: evaluate_asset_name
- uses: ncipollo/release-action@v1
with:
tag: ${{ inputs.release-version }}
name: Release ${{ inputs.release-version }}
body: |
${{ steps.Changelog.outputs.changelog }}
artifacts: ${{ inputs.asset-path }}/${{ steps.evaluate_asset_name.outputs.name }}