Release #34
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: Release | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Upload Release Asset | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 8 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '8' | |
| distribution: 'adopt' | |
| check-latest: false | |
| - name: Build with Maven | |
| run: mvn -B install -DskipTests | |
| - name: Create Tag | |
| run: | | |
| echo "RELEASE_TAG=`cat ./src/main/resources/.version`" >> $GITHUB_ENV | |
| - name: Create Release | |
| id: create_release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| allowUpdates: true | |
| artifacts: ./target/redis-rdb-cli-release.tar.gz,./target/redis-rdb-cli-release.zip | |
| tag: ${{ env.RELEASE_TAG }} | |
| name: ${{ env.RELEASE_TAG }} | |
| draft: false | |
| prerelease: false | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKER_USER }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Build and Push latest | |
| id: latest | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ./ | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ secrets.DOCKER_USER }}/${{ secrets.REPO }}:latest | |
| - name: Build and Push ${{ env.RELEASE_TAG }} | |
| id: tag | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ./ | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ secrets.DOCKER_USER }}/${{ secrets.REPO }}:${{ env.RELEASE_TAG }} | |
| - name: Image digest | |
| run: echo ${{ steps.docker_build.outputs.digest }} |