name: Release new Version permissions: contents: write on: pull_request: branches: ["release/*", "master"] #types: # - closed create: branches: - 'release/*' workflow_dispatch: jobs: build: name: Build and Release runs-on: self-hosted steps: - uses: actions/checkout@v4 - name: Set up JDK 21 uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' architecture: x64 - name: Set up Maven uses: stCarolas/setup-maven@v5 with: maven-version: 3.8.2 - name: Build with Maven run: mvn -B package --file pom.xml working-directory: Backend - run: mkdir release && ls - name: Archive dist folder run: cp Backend/target/schafkopf-backend-build-jar-with-dependencies.jar release/schafkopf-bot.jar && zip -r dist.zip release/schafkopf-bot.jar - name: Release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: files: dist.zip token: ${{ secrets.PAT }}