Skip to content

Commit 95d950f

Browse files
authored
Add ARM release artifacts (#593)
This change modifies the release process to produce artifacts suffixed by the build architecture (amd64, arm, arm64). Signed-off-by: Ali Ariff <[email protected]>
1 parent 40e1a62 commit 95d950f

File tree

3 files changed

+58
-6
lines changed

3 files changed

+58
-6
lines changed

.github/actions/package/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ FROM $BASE_IMAGE
33
WORKDIR /linkerd
44
RUN apt-get update && \
55
apt-get install -y jq && \
6+
apt-get install -y --no-install-recommends g++-aarch64-linux-gnu libc6-dev-arm64-cross && \
7+
rustup target add aarch64-unknown-linux-gnu && \
8+
apt-get install -y --no-install-recommends g++-arm-linux-gnueabihf libc6-dev-armhf-cross && \
9+
rustup target add armv7-unknown-linux-gnueabihf && \
610
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/
11+
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
12+
ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc
713
# v2.1.0
814
ARG CHECKSEC_SHA=04582bad41589ad479ca8b1f0170ed317475b5a5
915
RUN cd /usr/local/bin && curl -vsLO "https://raw.githubusercontent.com/slimm609/checksec.sh/$CHECKSEC_SHA/checksec" && chmod 755 checksec

.github/workflows/release.yml

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: release
1+
name: Release
22

33
on:
44
push:
@@ -7,6 +7,20 @@ on:
77

88
jobs:
99
package:
10+
strategy:
11+
matrix:
12+
architecture: [amd64, arm64, arm]
13+
include:
14+
- architecture: amd64
15+
target: x86_64-unknown-linux-gnu
16+
strip: strip
17+
- architecture: arm64
18+
target: aarch64-unknown-linux-gnu
19+
strip: aarch64-linux-gnu-strip
20+
- architecture: arm
21+
target: armv7-unknown-linux-gnueabihf
22+
strip: arm-linux-gnueabihf-strip
23+
name: Package (${{ matrix.architecture }})
1024
runs-on: ubuntu-latest
1125
steps:
1226
- name: git co
@@ -23,6 +37,9 @@ jobs:
2337
env:
2438
CARGO_RELEASE: "1"
2539
PACKAGE_VERSION: ${{ steps.release-tag-meta.outputs.name }}
40+
CARGO_TARGET: ${{ matrix.target }}
41+
STRIP: ${{ matrix.strip }}
42+
ARCH: ${{ matrix.architecture }}
2643
uses: ./.github/actions/package
2744
with:
2845
entrypoint: make
@@ -32,12 +49,40 @@ jobs:
3249
uses: ./.github/actions/package
3350
with:
3451
entrypoint: /linkerd/validate-checksec.sh
35-
args: /linkerd/expected-checksec.json "target/x86_64-unknown-linux-gnu/release/package/linkerd2-proxy-${{ steps.release-tag-meta.outputs.name }}-checksec.json"
52+
args: /linkerd/expected-checksec.json "target/${{ matrix.target }}/release/package/linkerd2-proxy-${{ steps.release-tag-meta.outputs.name }}-${{ matrix.architecture }}-checksec.json"
53+
54+
- name: upload artifacts
55+
uses: actions/upload-artifact@v2
56+
with:
57+
name: ${{ matrix.architecture }}-artifacts
58+
path: target/${{ matrix.target }}/release/package/*
59+
60+
release:
61+
needs: [package]
62+
name: GitHub Release
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: git co
66+
uses: actions/checkout@v1
67+
68+
- name: meta
69+
id: release-tag-meta
70+
uses: ./.github/actions/release-tag-meta
71+
with:
72+
git-ref: ${{ github.ref }}
73+
74+
- name: download artifacts
75+
uses: actions/download-artifact@v2
76+
with:
77+
path: artifacts
78+
79+
- name: display structure of downloaded files
80+
run: ls -R artifacts
3681

3782
- name: release
3883
uses: softprops/action-gh-release@b21b43d
3984
env:
4085
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4186
with:
4287
name: ${{ steps.release-tag-meta.outputs.name }}
43-
files: target/x86_64-unknown-linux-gnu/release/package/*
88+
files: artifacts/**/*

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ ifndef PACKAGE_VERSION
99
PACKAGE_VERSION = $(shell git rev-parse --short HEAD)
1010
endif
1111

12+
ARCH ?= amd64
1213
STRIP ?= strip
1314
PROFILING = profiling
1415
TARGET_BIN = $(TARGET)/linkerd2-proxy
1516
PKG_ROOT = $(TARGET)/package
16-
PKG_NAME = linkerd2-proxy-$(PACKAGE_VERSION)
17+
PKG_NAME = linkerd2-proxy-$(PACKAGE_VERSION)-$(ARCH)
1718
PKG_BASE = $(PKG_ROOT)/$(PKG_NAME)
1819
PKG_CHECKSEC = $(PKG_BASE)-checksec.json
1920
PKG = $(PKG_NAME).tar.gz
@@ -59,8 +60,8 @@ endif
5960
./checksec.sh $(PKG_BASE)/bin/linkerd2-proxy >$(PKG_CHECKSEC) || true
6061
cd $(PKG_ROOT) && \
6162
tar -czvf $(PKG) $(PKG_NAME) && \
62-
($(SHASUM) $(PKG) >$(PKG_NAME).txt) && \
63-
rm -rf $(PKG_BASE)
63+
($(SHASUM) $(PKG) >$(PKG_NAME).txt)
64+
rm -rf $(PKG_BASE)
6465

6566

6667
.PHONY: fetch

0 commit comments

Comments
 (0)