4646 default : true
4747
4848env :
49+ CARGO : " cargo auditable"
4950 CARGO_INCREMENTAL : 0
5051 CARGO_NET_RETRY : 10
5152 RUSTFLAGS : " -D warnings -A deprecated --cfg tokio_unstable"
@@ -60,48 +61,62 @@ jobs:
6061 timeout-minutes : 5
6162 runs-on : ${{ vars.LINKERD2_PROXY_RUNNER || 'ubuntu-24.04' }}
6263 steps :
63- - id : meta
64+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
65+ if : github.event_name == 'pull_request'
66+ - id : workflow
67+ if : github.event_name == 'pull_request'
68+ uses : tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c
69+ with :
70+ files : |
71+ .github/workflows/release.yml
72+ - id : build
73+ if : github.event_name == 'pull_request'
74+ uses : tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c
75+ with :
76+ files : |
77+ justfile
78+ Cargo.toml
79+
80+ - id : version
6481 env :
6582 VERSION : ${{ inputs.version }}
6683 shell : bash
6784 run : |
6885 set -euo pipefail
6986 shopt -s extglob
7087 if [[ "$GITHUB_EVENT_NAME" == pull_request ]]; then
71- echo version="0.0.0-test.${GITHUB_SHA:0:7}"
72- echo archs='["amd64"]'
73- echo oses='["linux"]'
88+ echo version="0.0.0-test.${GITHUB_SHA:0:7}" >> "$GITHUB_OUTPUT"
7489 exit 0
75- fi >> "$GITHUB_OUTPUT"
90+ fi
7691 if ! [[ "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+)?(\+[0-9A-Za-z-]+)?$ ]]; then
7792 echo "Invalid version: $VERSION" >&2
7893 exit 1
7994 fi
80- ( echo version="${VERSION#v}"
81- echo archs='["amd64", "arm64", "arm"]'
95+ echo version="${VERSION#v}" >> "$GITHUB_OUTPUT"
96+
97+ - id : platform
98+ shell : bash
99+ env :
100+ WORKFLOW_CHANGED : ${{ steps.workflow.outputs.any_changed }}
101+ run : |
102+ if [[ "$GITHUB_EVENT_NAME" == pull_request && "$WORKFLOW_CHANGED" != 'true' ]]; then
103+ ( echo archs='["amd64"]'
104+ echo oses='["linux"]' ) >> "$GITHUB_OUTPUT"
105+ exit 0
106+ fi
107+ ( echo archs='["amd64", "arm64"]'
82108 echo oses='["linux", "windows"]'
83109 ) >> "$GITHUB_OUTPUT"
84110
85- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
86- if : github.event_name == 'pull_request'
87- - id : changed
88- if : github.event_name == 'pull_request'
89- uses : tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c
90- with :
91- files : |
92- .github/workflows/release.yml
93- justfile
94- Cargo.toml
95-
96111 outputs :
97- archs : ${{ steps.meta .outputs.archs }}
98- oses : ${{ steps.meta .outputs.oses }}
99- version : ${{ steps.meta .outputs.version }}
100- package : ${{ github.event_name == 'workflow_dispatch' || steps.changed .outputs.any_changed == 'true' }}
112+ archs : ${{ steps.platform .outputs.archs }}
113+ oses : ${{ steps.platform .outputs.oses }}
114+ version : ${{ steps.version .outputs.version }}
115+ package : ${{ github.event_name == 'workflow_dispatch' || steps.build.outputs.any_changed == 'true' || steps.workflow .outputs.any_changed == 'true' }}
101116 profile : ${{ inputs.profile || 'release' }}
102117 publish : ${{ inputs.publish }}
103118 ref : ${{ inputs.ref || github.sha }}
104- tag : " ${{ inputs.tag-prefix || 'release/' }}v${{ steps.meta .outputs.version }}"
119+ tag : " ${{ inputs.tag-prefix || 'release/' }}v${{ steps.version .outputs.version }}"
105120 prerelease : ${{ inputs.prerelease }}
106121 draft : ${{ inputs.draft }}
107122 latest : ${{ inputs.latest }}
@@ -134,31 +149,33 @@ jobs:
134149 exclude :
135150 - os : windows
136151 arch : arm64
137- - os : windows
138- arch : arm
139152
140153 # If we're not actually building on a release tag, don't short-circuit on
141154 # errors. This helps us know whether a failure is platform-specific.
142155 continue-on-error : ${{ needs.meta.outputs.publish != 'true' }}
143156 runs-on : ${{ vars.LINKERD2_PROXY_RUNNER || 'ubuntu-24.04' }}
144157 timeout-minutes : 40
145- container : docker://ghcr.io/linkerd/dev:v46 -rust-musl
158+ container : docker://ghcr.io/linkerd/dev:v47 -rust-musl
146159 env :
147160 LINKERD2_PROXY_VENDOR : ${{ github.repository_owner }}
148161 LINKERD2_PROXY_VERSION : ${{ needs.meta.outputs.version }}
149162 steps :
150163 # TODO: add to dev image
151164 - name : Install MiniGW
152165 if : matrix.os == 'windows'
153- run : apt-get update && apt-get install mingw-w64 -y
166+ run : apt-get update && apt-get install -y mingw-w64
167+ - name : Install cross compilation toolchain
168+ if : matrix.arch == 'arm64'
169+ run : apt-get update && apt-get install -y binutils-aarch64-linux-gnu
170+
154171 - name : Configure git
155172 run : git config --global --add safe.directory "$PWD" # actions/runner#2033
156- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
173+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
157174 with :
158175 ref : ${{ needs.meta.outputs.ref }}
159176 - uses : Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0
160177 with :
161- key : ${{ matrix.arch }}
178+ key : ${{ matrix.os }}-${{ matrix. arch }}
162179 - run : just fetch
163180 - run : just arch=${{ matrix.arch }} libc=${{ matrix.libc }} os=${{ matrix.os }} rustup
164181 - run : just arch=${{ matrix.arch }} libc=${{ matrix.libc }} os=${{ matrix.os }} profile=${{ needs.meta.outputs.profile }} build
@@ -187,7 +204,7 @@ jobs:
187204 git config --global user.name "$GITHUB_USERNAME"
188205 git config --global user.email "$GITHUB_USERNAME"@users.noreply.github.com
189206 # Tag the release.
190- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
207+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
191208 with :
192209 token : ${{ secrets.LINKERD2_PROXY_GITHUB_TOKEN || github.token }}
193210 ref : ${{ needs.meta.outputs.ref }}
0 commit comments