Skip to content

Commit dda15fd

Browse files
authored
Auto trigger android release build on tag (#17227)
When a release tag is created, trigger android-release-build.yml
1 parent d9bc1ac commit dda15fd

2 files changed

Lines changed: 68 additions & 2 deletions

File tree

.github/workflows/android-release-artifacts.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
name: Android Release Artifacts
22

33
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
description: Version name to be uploaded for AAR release
8+
required: false
9+
type: string
10+
default: ''
11+
upload_to_maven:
12+
description: Upload the AAR to maven staging repository
13+
required: false
14+
type: boolean
15+
default: false
16+
flavor:
17+
description: Build flavor
18+
required: false
19+
type: string
20+
default: 'xnnpack'
421
workflow_dispatch:
522
inputs:
623
version:
@@ -27,26 +44,32 @@ jobs:
2744
name: check-if-aar-exists
2845
runs-on: ubuntu-22.04
2946
timeout-minutes: 10
47+
outputs:
48+
should-skip: ${{ steps.check.outputs.should-skip }}
3049
steps:
3150
- name: Check if this RC version is already in S3
51+
id: check
3252
shell: bash
3353
run: |
3454
VERSION="${{ inputs.version }}"
3555
FLAVOR="${{ inputs.flavor }}"
3656
if [ -z "$VERSION" ]; then
3757
echo "No version name specified. Will create a snapshot AAR"
58+
echo "should-skip=false" >> $GITHUB_OUTPUT
3859
exit 0
3960
fi
4061
if curl -I "https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}-${FLAVOR}/executorch.aar" | grep "200 OK"; then
4162
echo "AAR already exists at https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}-${FLAVOR}/executorch.aar"
4263
echo "Will skip build/upload"
43-
exit 1
64+
echo "should-skip=true" >> $GITHUB_OUTPUT
65+
else
66+
echo "should-skip=false" >> $GITHUB_OUTPUT
4467
fi
4568
4669
build-aar:
4770
name: build-aar
4871
needs: check-if-aar-exists
49-
if: ${{ !github.event.pull_request.head.repo.fork }}
72+
if: ${{ !github.event.pull_request.head.repo.fork && needs.check-if-aar-exists.outputs.should-skip != 'true' }}
5073
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
5174
secrets: inherit
5275
permissions:
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Android Release on Tag
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*-rc*'
7+
- 'v*.*.*'
8+
9+
jobs:
10+
prepare:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
version: ${{ steps.get-version.outputs.version }}
14+
steps:
15+
- id: get-version
16+
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
17+
18+
release-xnnpack:
19+
needs: prepare
20+
uses: ./.github/workflows/android-release-artifacts.yml
21+
secrets: inherit
22+
with:
23+
version: ${{ needs.prepare.outputs.version }}
24+
flavor: xnnpack
25+
upload_to_maven: true
26+
27+
release-vulkan:
28+
needs: prepare
29+
uses: ./.github/workflows/android-release-artifacts.yml
30+
secrets: inherit
31+
with:
32+
version: ${{ needs.prepare.outputs.version }}
33+
flavor: vulkan
34+
upload_to_maven: true
35+
36+
release-qnn:
37+
needs: prepare
38+
uses: ./.github/workflows/android-release-artifacts.yml
39+
secrets: inherit
40+
with:
41+
version: ${{ needs.prepare.outputs.version }}
42+
flavor: qnn
43+
upload_to_maven: true

0 commit comments

Comments
 (0)