-
Notifications
You must be signed in to change notification settings - Fork 8.9k
103 lines (99 loc) · 3.13 KB
/
release.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
# Copyright the Hyperledger Fabric contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
name: Release
on:
workflow_dispatch:
inputs:
release:
description: 'Fabric Release, e.g. 2.4.7'
required: true
type: string
two_digit_release:
description: 'Fabric Two Digit Release, e.g. 2.4'
required: true
type: string
commit_hash:
description: 'Commit hash, e.g. df9c661a192f8cf11376d9d643a0021f1a76c34b'
required: true
type: string
env:
GO_VER: 1.21.6
permissions:
contents: read
jobs:
build-binaries:
name: Build Fabric Binaries
strategy:
matrix:
include:
- image: ubuntu-20.04
target: linux
arch: amd64
- image: macos-11
target: darwin
arch: amd64
- image: windows-2022
target: windows
arch: amd64
runs-on: ubuntu-20.04
steps:
- name: Checkout Fabric Code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VER }}
- name: Compile Binary and Create Tarball
run: ./ci/scripts/create_binary_package.sh
env:
TARGET: ${{ matrix.target }}-${{ matrix.arch }}
RELEASE: ${{ inputs.release }}
- name: Publish Release Artifact
uses: actions/upload-artifact@v3
with:
name: hyperledger-fabric-${{ matrix.target }}-${{ matrix.arch }}-${{ inputs.release }}.tar.gz
path: release/${{ matrix.target }}-${{ matrix.arch }}/hyperledger-fabric-${{ matrix.target }}-${{ matrix.arch }}-${{ inputs.release }}.tar.gz
build-and-push-docker-images:
name: Build and Push Fabric Docker Images
runs-on: ubuntu-20.04
steps:
- name: Run APT Clean
run: sudo apt clean
- name: Run Apt Update
run: sudo apt update
- name: Install Dependencies
run: sudo apt install -y gcc haveged libtool make
- name: Checkout Fabric Code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VER }}
- name: Publish Docker Images
run: ./ci/scripts/publish_docker.sh
env:
RELEASE: ${{ inputs.release }}
TWO_DIGIT_RELEASE: ${{ inputs.two_digit_release }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
create-release:
name: Create GitHub Release
needs: [ build-binaries, build-and-push-docker-images ]
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- name: Checkout Fabric Code
uses: actions/checkout@v4
- name: Download Artifacts
id: download
uses: actions/download-artifact@v3
- name: Release Fabric Version
uses: ncipollo/release-action@v1
with:
artifacts: "*.tar.gz/*.tar.gz"
bodyFile: release_notes/v${{ inputs.release }}.md
commit: ${{ inputs.commit_hash }}
tag: v${{ inputs.release }}
token: ${{ secrets.GITHUB_TOKEN }}