Merge pull request #112 from ONLYOFFICE/develop #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: [master] | |
jobs: | |
artifact: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- 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 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- 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 }} |