Artifact #25
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: Artifact | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [opened, reopened] | |
branches: [master] | |
jobs: | |
artifact: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
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: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.info.outputs.artifact }}-${{ steps.info.outputs.version }} | |
path: ${{ steps.info.outputs.artifact }}-${{ steps.info.outputs.version }}.jar |