-
Notifications
You must be signed in to change notification settings - Fork 10
94 lines (91 loc) · 3.22 KB
/
manual_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
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
name: Manual Release
on:
workflow_dispatch:
inputs:
confirmeRelease:
description: 'Confirm manual release creation (by typing "true") ? ----- WARNING : check version (in pom.xml files) and release notes (in CHANGELOG.md file) before confirm'
default: 'false'
jobs:
checks:
name: Requirements
if: github.event.inputs.confirmeRelease == 'true'
runs-on: ubuntu-latest
steps:
- name: Check user permissions
uses: 74th/[email protected]
with:
users: dedece35,glalloue,jhertout,jules-delecour-dav,olegoaer,zippy1978,utarwyn
build:
name: Build And Release
needs: checks
runs-on: ubuntu-latest
permissions: write-all
outputs:
last_tag: ${{ steps.export_last_tag.outputs.last_tag }}
upload_url: ${{ steps.export_upload_url.outputs.upload_url }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Change commiter
run: |
git config user.name 'github-actions[bot]'
git config user.email ''
- name: Maven release
run: mvn release:prepare -B -ff -DtagNameFormat=@{project.version}
- name: Maven release clean
run: mvn release:clean
- name: Get last TAG
run: echo "LAST_TAG=$(git tag --sort=-version:refname | head -n 1)" >> $GITHUB_ENV
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
- name: Checkout tag "${{ env.LAST_TAG }}"
uses: actions/checkout@v3
with:
ref: ${{ env.LAST_TAG }}
- name: Build project
run: mvn -e -B clean package -DskipTests
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.LAST_TAG }}
release_name: Release ${{ env.LAST_TAG }}
draft: false
prerelease: false
body: ${{ steps.extract-release-notes.outputs.release_notes }}
- name: Export plugin Jar files
id: export_jar_files
uses: actions/upload-artifact@v3
with:
name: creedengo-plugins
path: lib
- name: Export LAST_TAG
id: export_last_tag
run: echo "last_tag=${{ env.LAST_TAG }}" >> $GITHUB_OUTPUT
- name: Export UPLOAD_URL
id: export_upload_url
run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_OUTPUT
upload:
name: Upload Python Plugin
runs-on: ubuntu-latest
needs: build
steps:
- name: Import plugin JAR files
id: import_jar_files
uses: actions/download-artifact@v3
with:
name: creedengo-plugins
path: lib
- name: Upload Release Asset - Python Plugin
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{needs.build.outputs.upload_url}}
asset_path: lib/creedengo-python-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_name: creedengo-python-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_content_type: application/zip