Split up actions (#129)
* Refactor conditional dependent jobs into separate actions * Fix incorrect usage of pull_request_target * Fix Dependabot not merging due to labels being absent when issue is created * Prettify supported version listing
This commit is contained in:
		
							
								
								
									
										53
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										53
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							@@ -2,7 +2,7 @@ name: OpenInv CI
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  push:
 | 
			
		||||
  pull_request_target:
 | 
			
		||||
  pull_request:
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  build:
 | 
			
		||||
@@ -36,54 +36,3 @@ jobs:
 | 
			
		||||
        with:
 | 
			
		||||
          name: api
 | 
			
		||||
          path: ./api/target/openinvapi*.jar
 | 
			
		||||
 | 
			
		||||
  merge-dependabot:
 | 
			
		||||
    name: Auto-merge Dependabot PRs
 | 
			
		||||
    needs: [ build ]
 | 
			
		||||
    if: "github.event.name == 'pull_request_target'
 | 
			
		||||
      && github.actor == 'dependabot[bot]'
 | 
			
		||||
      && contains( github.event.pull_request.labels.*.name, 'java')"
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Approve
 | 
			
		||||
        uses: hmarr/auto-approve-action@v3.1.0
 | 
			
		||||
        with:
 | 
			
		||||
          github-token: "${{ secrets.GITHUB_TOKEN }}"
 | 
			
		||||
      - name: Merge
 | 
			
		||||
        uses: pascalgn/automerge-action@v0.15.6
 | 
			
		||||
        env:
 | 
			
		||||
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
 | 
			
		||||
          MERGE_LABELS: "dependencies"
 | 
			
		||||
          MERGE_METHOD: "squash"
 | 
			
		||||
 | 
			
		||||
  release:
 | 
			
		||||
    name: Create Github Release
 | 
			
		||||
    needs: [ build ]
 | 
			
		||||
    if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
      # Fetch all history - used to assemble changelog.
 | 
			
		||||
      - uses: actions/checkout@v3
 | 
			
		||||
        with:
 | 
			
		||||
          fetch-depth: 0
 | 
			
		||||
 | 
			
		||||
      - name: Set Release Variables
 | 
			
		||||
        run: bash ./scripts/set_release_env.sh
 | 
			
		||||
 | 
			
		||||
      - name: Download Artifact
 | 
			
		||||
        uses: actions/download-artifact@v3
 | 
			
		||||
        with:
 | 
			
		||||
          name: dist
 | 
			
		||||
          path: dist
 | 
			
		||||
 | 
			
		||||
      - name: Create Release
 | 
			
		||||
        id: create-release
 | 
			
		||||
        uses: softprops/action-gh-release@v0.1.15
 | 
			
		||||
        env:
 | 
			
		||||
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
			
		||||
        with:
 | 
			
		||||
          name: ${{ env.VERSIONED_NAME }}
 | 
			
		||||
          body: ${{ env.GENERATED_CHANGELOG }}
 | 
			
		||||
          draft: true
 | 
			
		||||
          prerelease: false
 | 
			
		||||
          files: ./dist/OpenInv.jar
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user