mirror of
				https://github.com/vran-dev/databasir.git
				synced 2025-11-04 08:22:28 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			55 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: release
 | 
						|
 | 
						|
on:
 | 
						|
  workflow_dispatch:
 | 
						|
    inputs:
 | 
						|
      tag:
 | 
						|
        required: true
 | 
						|
        description: 'release tag version'
 | 
						|
 | 
						|
jobs:
 | 
						|
  release:
 | 
						|
    runs-on: ubuntu-latest
 | 
						|
 | 
						|
    steps:
 | 
						|
      - uses: actions/checkout@v2
 | 
						|
      - name: Set up JDK 11
 | 
						|
        uses: actions/setup-java@v1
 | 
						|
        with:
 | 
						|
          java-version: '11'
 | 
						|
          server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
 | 
						|
          settings-path: ${{ github.workspace }} # location for the settings.xml file
 | 
						|
 | 
						|
      - name: Gradle Permission Grant
 | 
						|
        run: chmod +x ./gradlew
 | 
						|
 | 
						|
      - name: Gradle Build
 | 
						|
        run: ./gradlew api:build -x checkstyleMain -x checkstyleTest
 | 
						|
 | 
						|
      - name: Application Jar Release
 | 
						|
        uses: softprops/action-gh-release@v1
 | 
						|
        with:
 | 
						|
          tag_name: ${{ github.event.inputs.tag }}
 | 
						|
          files: api/build/libs/databasir.jar
 | 
						|
          draft: true
 | 
						|
          fail_on_unmatched_files: true
 | 
						|
        env:
 | 
						|
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
						|
 | 
						|
      - name: Login to Docker Hub
 | 
						|
        uses: docker/login-action@v1
 | 
						|
        with:
 | 
						|
          username: ${{ secrets.DOCKER_HUB_USERNAME }}
 | 
						|
          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
 | 
						|
 | 
						|
      - name: Set up Docker Buildx
 | 
						|
        uses: docker/setup-buildx-action@v1
 | 
						|
 | 
						|
      - name: Docker Image Release
 | 
						|
        uses: docker/build-push-action@v2
 | 
						|
        with:
 | 
						|
          context: .
 | 
						|
          file: ./local.Dockerfile
 | 
						|
          platforms: linux/amd64,linux/arm64
 | 
						|
          push: true
 | 
						|
          tags: ${{ secrets.DOCKER_HUB_USERNAME }}/databasir:${{ github.event.inputs.tag }} |