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..1530edf --- /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: 'target/neon-plugins.jar' + asset_content_type: 'application/java-archive'