name: release

on:
  push:
    tags:
      - "arthas-all-*"

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Setup java
        uses: actions/setup-java@v3
        with:
          java-version: '8'
          distribution: 'adopt'
      - name: Build with Maven
        run: mvn clean package -P full

      - name: Release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            packaging/target/*.zip
            packaging/target/*.deb
            packaging/target/*.rpm
            tunnel-server/target/*fatjar.jar
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

