RequestBin Collaborator init #1
  
    
      This file contains hidden or 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: Build and Publish | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| release_notes: | |
| description: 'Optional custom release notes to add to the release body.' | |
| required: false | |
| type: string | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| types: | |
| - closed | |
| branches: | |
| - master | |
| jobs: | |
| release-and-publish: | |
| name: Release and Publish | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| github.event_name == 'push'|| github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository history | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK 17 and cache Maven dependencies | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'maven' | |
| - name: Build project with Maven | |
| run: mvn clean package -DskipTests -B | |
| - name: Bump version and push tag | |
| id: tag_version | |
| uses: erodozer/github-tag-action@fix-tag-existing | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch_all_tags: true | |
| default_bump: false | |
| force_update: true | |
| - name: Rename artifact | |
| id: rename_artifact | |
| run: | | |
| cp ./target/collaborator-*-jar-with-dependencies.jar ./target/interactsh-collaborator.jar | |
| - name: Create a GitHub release | |
| uses: ncipollo/release-action@v1 | |
| if: steps.tag_version.outputs.new_version != '' | |
| with: | |
| tag: ${{ steps.tag_version.outputs.new_tag }} | |
| name: ${{ steps.tag_version.outputs.new_tag }} | |
| body: ${{ github.event.inputs.release_notes || steps.tag_version.outputs.changelog || format('Official release of version {0}. The attached JAR file contains the compiled application and all dependencies.', steps.tag_version.outputs.new_version ) }} | |
| artifacts: ./target/interactsh-collaborator.jar |