From 12f55444d8713a7f03c69f8fe07d724237d15b5d Mon Sep 17 00:00:00 2001 From: Dmitry Savelev Date: Thu, 3 Oct 2024 23:52:21 +0200 Subject: [PATCH] Create Github workflow --- .github/workflows/pull_request.yml | 30 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 32 ++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/pull_request.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..d9a5982 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,30 @@ +name: Build and create an artifact + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - labeled + +jobs: + build_and_test: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'oracle' + + - name: Build project with Maven + run: mvn -B package --file pom.xml + + - uses: actions/upload-artifact@v4 + with: + name: Package + path: target/neon-plugins.jar diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..14fa8b6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Create release artifact + +on: + release: + types: + - published + +jobs: + build_and_test: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'oracle' + + - name: Build project with Maven + run: mvn -B package --file pom.xml + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_name: 'neon-plugins.jar' + asset_path: 'neon-plugins.jar' + asset_content_type: 'application/java-archive'