diff --git a/.github/workflows/release-nethermind.yml b/.github/workflows/release-nethermind.yml index af6b8806496..29381ad091b 100644 --- a/.github/workflows/release-nethermind.yml +++ b/.github/workflows/release-nethermind.yml @@ -25,7 +25,7 @@ jobs: BUILD_TIMESTAMP: ${{ steps.build-runner.outputs.BUILD_TIMESTAMP }} COMMIT_HASH: ${{ steps.build-runner.outputs.COMMIT_HASH }} PACKAGE_PREFIX: ${{ steps.archive.outputs.PACKAGE_PREFIX }} - PRERELEASE: ${{ contains(github.event.inputs.tag, '-') }} + PRERELEASE: ${{ steps.build-runner.outputs.PRERELEASE }} steps: - name: Check out Nethermind repository uses: actions/checkout@v3 @@ -60,6 +60,7 @@ jobs: echo "BUILD_TIMESTAMP=$build_timestamp" >> $GITHUB_OUTPUT echo "COMMIT_HASH=$commit_hash" >> $GITHUB_OUTPUT echo "COMMIT_HASH_SHORT=$(echo $commit_hash | awk '{print substr($0,0,8);}')" >> $GITHUB_OUTPUT + echo "PRERELEASE=${{ contains(github.event.inputs.tag, '-') }}" >> $GITHUB_OUTPUT $SCRIPTS_PATH/build-runner.sh ${{ github.event.inputs.tag }} $commit_hash $build_timestamp - name: Build Nethermind.Cli run: $SCRIPTS_PATH/build-cli.sh ${{ github.event.inputs.tag }} ${{ steps.build-runner.outputs.COMMIT_HASH }} ${{ steps.build-runner.outputs.BUILD_TIMESTAMP }} @@ -207,12 +208,12 @@ jobs: if: success() run: | echo "${{ secrets.DOCKER_ACCESS_TOKEN }}" | docker login --username "${{ secrets.DOCKER_USERNAME }}" --password-stdin - - name: Build and push image to Docker registry (major) / trigger DAppNode build + - name: Build and push image to Docker Hub / Trigger DAppNode build if: needs.build.outputs.PRERELEASE == 'false' run: | docker buildx build --platform=linux/amd64,linux/arm64 -t "${{ env.DOCKER_IMAGE }}:latest" -t "${{ env.DOCKER_IMAGE }}:${{ github.event.inputs.tag }}" -f Dockerfile --build-arg COMMIT_HASH=${{ needs.build.outputs.COMMIT_HASH }} --build-arg BUILD_TIMESTAMP=${{ needs.build.outputs.BUILD_TIMESTAMP }} . --push curl -s -X POST -u "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" -d '{"event_type":"dappnode","client_payload":{"tag":"${{ github.event.inputs.tag }}"}}' https://api.github.com/repos/$GITHUB_REPOSITORY/dispatches - - name: Build and push image to Docker registry (patch) + - name: Build and push image to Docker Hub if: needs.build.outputs.PRERELEASE == 'true' run: | docker buildx build --platform=linux/amd64,linux/arm64 -t "${{ env.DOCKER_IMAGE }}:unstable" -t "${{ env.DOCKER_IMAGE }}:${{ github.event.inputs.tag }}" -f Dockerfile --build-arg COMMIT_HASH=${{ needs.build.outputs.COMMIT_HASH }} --build-arg BUILD_TIMESTAMP=${{ needs.build.outputs.BUILD_TIMESTAMP }} . --push