forked from moonbeam-foundation/moonbeam
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (66 loc) · 2.36 KB
/
prepare-binary.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
name: Prepare Optimized Binary Draft (internal only)
# The code (like generate-release-body) will be taken from the tag version, not master
on:
workflow_dispatch:
inputs:
sha:
description: full sha to build the binary from
required: true
tag:
description: docker tag to apply to the image
required: true
jobs:
####### Building binaries #######
build-binary:
runs-on: moonbeam-release-medium
permissions:
contents: read
strategy:
matrix:
cpu: ["x86-64", "skylake", "znver3"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cargo build
uses: ./.github/workflow-templates/build-prod-binary
with:
target: ${{ matrix.cpu }}
####### Prepare the release draft #######
docker-release-candidate:
runs-on: ubuntu-latest
permissions:
contents: read
needs: ["build-binary"]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: binaries-*
merge-multiple: true
path: build
- name: Prepare
id: prep
run: |
echo "rename default binary"
mv build/moonbeam-x86-64 build/moonbeam
DOCKER_IMAGE=moonbeamfoundation/moonbeam
COMMIT_SHA8=`echo ${{ github.event.inputs.sha }} | cut -c1-8`
TAG_SHA="${DOCKER_IMAGE}:sha-${COMMIT_SHA8}"
TAG_VER="${DOCKER_IMAGE}:${{ github.event.inputs.tag }}"
TAGS="${TAG_SHA},${TAG_VER}"
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Cargo build
uses: ./.github/workflow-templates/publish-docker
with:
dockerhub_username: ${{ secrets.MBF_DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.MBF_DOCKERHUB_PASSWORD }}
image_tags: ${{ steps.prep.outputs.tags }}
image_title: ${{ github.event.repository.name }}
image_description: ${{ github.event.repository.description }}
image_url: ${{ github.event.repository.html_url }}
image_source: ${{ github.event.repository.clone_url }}
image_created: ${{ steps.prep.outputs.created }}
image_revision: ${{ github.sha }}
image_licenses: ${{ github.event.repository.license.spdx_id }}