-
Notifications
You must be signed in to change notification settings - Fork 29
46 lines (44 loc) · 1.78 KB
/
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
name: Release
on:
push:
branches: [master]
jobs:
artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get Info
run: |
echo "version=$(awk '/<version>/,/<\/version>/' pom.xml | head -n 1 | sed 's/^[[:space:]]*//g' | sed -n 's:.*<version>\(.*\)</version>.*:\1:p')" >> $GITHUB_OUTPUT
echo "artifact=$(awk '/<artifactId>/,/<\/artifactId>/' pom.xml | head -n 1 | sed 's/^[[:space:]]*//g' | sed -n 's:.*<artifactId>\(.*\)</artifactId>.*:\1:p')" >> $GITHUB_OUTPUT
id: info
- name: Install Java 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Build Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
sudo sh -c 'echo "deb https://packages.atlassian.com/debian/atlassian-sdk-deb/ stable contrib" >>/etc/apt/sources.list'
wget https://packages.atlassian.com/api/gpg/key/public
sudo apt-key add public
sudo apt-get update -y
sudo apt-get install atlassian-plugin-sdk -y
atlas-version
atlas-package
cd ./target
mv ${{ steps.info.outputs.artifact }}-${{ steps.info.outputs.version }}.jar $cwd
- name: Generate Changelog
run: |
awk '/## [0-9]/{p++} p; /## [0-9]/{if (p > 1) exit}' CHANGELOG.md | awk 'NR>2 {print last} {last=$0}' > RELEASE.md
- name: Create Release
uses: ncipollo/release-action@v1
id: create_release
with:
artifacts: "${{ steps.info.outputs.artifact }}-${{ steps.info.outputs.version }}.jar"
bodyFile: RELEASE.md
tag: v${{ steps.info.outputs.version }}