dash/.github/workflows/release_alpha.yml
UdjinM6 d574ca6197
ci: bump actions/checkout and actions/cache to v3 (#5519)
## Issue being fixed or feature implemented
Should fix warnings like
> The following actions uses node12 which is deprecated and will be
forced to run on node16: actions/checkout@v2, actions/cache@v2. For more
info:
https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

https://github.com/dashpay/dash/actions/runs/5705358251?pr=5448
https://github.com/dashpay/dash/actions/runs/5705358315?pr=5448
https://github.com/dashpay/dash/actions/runs/5705358316?pr=5448
https://github.com/dashpay/dash/actions/runs/5715249078?pr=5448

## What was done?

## How Has This Been Tested?

## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone
2023-08-01 12:17:40 -05:00

102 lines
2.8 KiB
YAML

name: Build and push image
on:
workflow_dispatch:
inputs:
tag:
description: 'Docker tag'
required: true
jobs:
build:
name: Run Gitian build
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: dash
- name: Checkout Gitian builder
uses: actions/checkout@v3
with:
repository: devrandom/gitian-builder
path: gitian-builder
- name: Checkout detached sigs
uses: actions/checkout@v3
with:
repository: dashpay/dash-detached-sigs
path: dash-detached-sigs
- name: Checkout gitian sigs
uses: actions/checkout@v3
with:
repository: dashpay/gitian.sigs
path: gitian.sigs
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
with:
images: dashpay/dashd
tags: |
type=semver,pattern={{version}},value=${{ github.event.inputs.tag }}
type=raw,value=latest-dev
flavor: |
latest=false
- name: Install apt-cacher-ng
run: sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq apt-cacher-ng
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5
- name: Prepare Gitian
run: dash/contrib/gitian-build.py --setup "dummy" "${{ steps.branch-name.outputs.current_branch }}"
- uses: actions/cache@v3
id: ccache
with:
path: /opt/actions-runner/_work/dash/dash/gitian-builder/cache/dash-linux-0.17
key: ${{ runner.os }}-ccache-${{ github.sha }}
restore-keys: ${{ runner.os }}-ccache-
- name: Run Gitian build
run: |
export GPG_TTY=$(tty)
dash/contrib/gitian-build.py -c -b -n -D -o l \
-u https://github.com/dashpay/dash \
-j $(nproc) -m `awk '/^Mem/ {print $7}' <(free -m)` \
dummy ${{ steps.branch-name.outputs.current_branch }}
- name: Set up QEMU to run multi-arch builds
uses: docker/setup-qemu-action@v1
- name: Set up Docker BuildX
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: v0.8.0
install: true
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v2
with:
context: ${{ github.workspace }}
file: ./dash/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
build-args: |
TAG=${{ steps.docker_meta.outputs.version }}
BRANCH=${{ steps.branch-name.outputs.current_branch }}