chore: bump express from 4.21.2 to 4.22.1 in /tools/debug-ui (#14732) #3710
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: Neard binary and Docker image release | |
| # cspell:ignore dockerhub Warpbuilds | |
| on: | |
| # Run when a new release or rc is created | |
| release: | |
| types: [published] | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| default: 'master' | |
| description: "Nearcore branch to build and publish" | |
| type: string | |
| required: true | |
| jobs: | |
| binary-release: | |
| name: "Build and publish ${{matrix.name}} neard binary" | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Intel Linux Ubuntu | |
| os: warp-ubuntu-2204-x64-16x | |
| - name: ARM Linux Ubuntu | |
| os: warp-ubuntu-2404-arm64-16x | |
| environment: deploy | |
| permissions: | |
| id-token: write # required to use OIDC authentication | |
| steps: | |
| - name: Checkout ${{ github.event.inputs.branch }} branch | |
| if: ${{ github.event_name == 'workflow_dispatch'}} | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.branch }} | |
| persist-credentials: false | |
| - name: Checkout nearcore release | |
| # for release events we need to checkout all branches to be able to determine | |
| # later branch name | |
| if: ${{ github.event_name != 'workflow_dispatch' && github.event_name == 'release'}} | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Checkout repository for master branch | |
| # In case of master branch we want to checkout with depth 1 | |
| if: ${{ github.event_name != 'workflow_dispatch' && github.event_name != 'release'}} | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: arn:aws:iam::590184106962:role/GitHubActionsRunner | |
| aws-region: us-west-1 | |
| - name: Neard binary build and upload to S3 | |
| run: ./scripts/binary_release.sh | |
| - name: Update latest version metadata in S3 | |
| run: | | |
| echo $(git rev-parse HEAD) > latest | |
| BRANCH=$(git branch --show-current) | |
| # in case of Release triggered run, branch is empty | |
| if [ -z "$BRANCH" ]; then | |
| BRANCH=$(git branch -r --contains=${GITHUB_REF_NAME} | head -n1 | cut -c3- | cut -d / -f 2) | |
| fi | |
| UPLOAD_TARGETS=() | |
| if [ -n "$BRANCH" ]; then | |
| UPLOAD_TARGETS+=("$BRANCH") | |
| fi | |
| if [ "${{ github.event_name }}" = "release" ]; then | |
| RELEASE_TAG="${{ github.event.release.tag_name }}" | |
| if [ -n "$RELEASE_TAG" ] && [ "$BRANCH" != "$RELEASE_TAG" ]; then | |
| UPLOAD_TARGETS+=("$RELEASE_TAG") | |
| fi | |
| fi | |
| if [ ${#UPLOAD_TARGETS[@]} -eq 0 ]; then | |
| echo "Unable to determine upload target for latest metadata" >&2 | |
| exit 1 | |
| fi | |
| for target in "${UPLOAD_TARGETS[@]}"; do | |
| aws s3 cp --acl public-read latest s3://build.nearprotocol.com/nearcore/$(uname)/${target}/latest | |
| done | |
| - name: Trigger release metadata update workflow | |
| if: ${{ matrix.name == 'Intel Linux Ubuntu' && github.event_name == 'release' }} | |
| run: | | |
| curl -L -X POST -H "Accept: application/vnd.github+json" \ | |
| --fail-with-body \ | |
| -H "Authorization: Bearer ${{ secrets.NEARONE_GITHUB_TOKEN }}" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| https://api.github.com/repos/Near-One/infra-ops/dispatches \ | |
| -d '{"event_type":"metadata-update","client_payload":{"release":"${GITHUB_REF_NAME}"}}' | |
| docker-release: | |
| name: "Build and publish nearcore Docker image" | |
| runs-on: warp-ubuntu-2204-x64-2x | |
| environment: deploy | |
| steps: | |
| - name: Checkout ${{ github.event.inputs.branch }} branch | |
| if: ${{ github.event_name == 'workflow_dispatch'}} | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.branch }} | |
| persist-credentials: false | |
| - name: Checkout nearcore release | |
| # for release events we need to checkout all branches to be able to determine | |
| # later branch name | |
| if: ${{ github.event_name != 'workflow_dispatch' && github.event_name == 'release'}} | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Checkout repository for master branch | |
| # In case of master branch we want to checkout with depth 1 | |
| if: ${{ github.event_name != 'workflow_dispatch' && github.event_name != 'release'}} | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_PAT_TOKEN }} | |
| - name: Prepare dockerhub tags | |
| run: | | |
| COMMIT=$(git rev-parse HEAD) | |
| BRANCH=$(git branch --show-current) | |
| # in case of Release triggered run, branch is empty | |
| if [ -z "$BRANCH" ]; then | |
| BRANCH=$(git branch -r --contains=${GITHUB_REF_NAME} | head -n1 | cut -c3- | cut -d / -f 2) | |
| fi | |
| TAGS=() | |
| if [ "$GITHUB_EVENT_NAME" = "release" ]; then | |
| TAGS+=("${GITHUB_REF_NAME}") | |
| TAGS+=("${GITHUB_REF_NAME}-${COMMIT}") | |
| if [ "${{ github.event.release.prerelease }}" = "true" ]; then | |
| TAGS+=("pre-release") | |
| else | |
| TAGS+=("release") | |
| fi | |
| else | |
| TAGS+=("$BRANCH") | |
| TAGS+=("$BRANCH-${COMMIT}") | |
| fi | |
| if [[ ${BRANCH} == "master" ]]; then | |
| TAGS+=("latest") | |
| fi | |
| DOCKER_TAGS=() | |
| for tag in "${TAGS[@]}"; do | |
| DOCKER_TAGS+=("nearprotocol/nearcore:$tag") | |
| done | |
| CSV=$(IFS=','; echo "${DOCKER_TAGS[*]}") | |
| echo "DOCKER_TAGS=${CSV}" >> $GITHUB_ENV | |
| - name: Build and push Docker image to Dockerhub | |
| uses: Warpbuilds/build-push-action@v6 | |
| with: | |
| context: . | |
| profile-name: "nearcore-image-builder" | |
| push: true | |
| file: Dockerfile | |
| build-args: | | |
| make_target=neard-release | |
| tags: ${{ env.DOCKER_TAGS }} | |