-
Notifications
You must be signed in to change notification settings - Fork 4
110 lines (94 loc) · 3.13 KB
/
release_alpha.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Build and push image
on:
workflow_dispatch:
inputs:
tag:
description: 'Git/Docker tag (without v)'
required: true
jobs:
build:
name: Run Gitian build
runs-on: [ "self-hosted", "linux", "x64", "ubuntu-core" ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: dash
ref: develop
- 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@v4
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 update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq apt-cacher-ng
- name: Set major version environment variable
id: major-version
run: |
VERSION=${{ github.event.inputs.tag }}
echo "MAJOR_VERSION=${VERSION%%.*}" >> $GITHUB_OUTPUT
- name: Prepare Gitian
run: dash/contrib/gitian-build.py --setup "dummy" "${{ github.event.inputs.tag }}"
- uses: actions/cache@v3
id: ccache
with:
path: /opt/actions-runner/_work/dash/dash/gitian-builder/cache/dash-linux-${{ steps.major-version.outputs.MAJOR_VERSION }}
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 -b -n -D -o l \
-u https://github.com/dashevo/dash-evo-branches \
-j $(nproc) -m `awk '/^Mem/ {print $7}' <(free -m)` \
dummy ${{ github.event.inputs.tag }}
- name: Set up QEMU to run multi-arch builds
uses: docker/setup-qemu-action@v2
- name: Set up Docker BuildX
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: v0.10.2
install: true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v4
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=${{ github.event.inputs.tag }}
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3