Skip to content

Commit bf38a0e

Browse files
authored
Merge pull request #28 from hawkff/chore/ci-artifact-bus
ci: pass build artifacts between jobs via upload/download-artifact
2 parents 332c29e + d281225 commit bf38a0e

4 files changed

Lines changed: 92 additions & 72 deletions

File tree

.github/workflows/build.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ jobs:
4040
- name: Native Build
4141
if: steps.cache.outputs.cache-hit != 'true'
4242
run: ./run lib core
43+
- name: Upload LibCore
44+
uses: actions/upload-artifact@v5
45+
with:
46+
name: libcore-aar-build
47+
path: app/libs/libcore.aar
48+
retention-days: 1
49+
if-no-files-found: error
4350
sidecars:
4451
name: Native Build (Sidecars)
4552
runs-on: namespace-profile-nekoyay
@@ -72,6 +79,13 @@ jobs:
7279
- name: Naive Download
7380
if: steps.cache.outputs.cache-hit != 'true'
7481
run: ./run lib naive
82+
- name: Upload Sidecars
83+
uses: actions/upload-artifact@v5
84+
with:
85+
name: sidecars-so-build
86+
path: app/executableSo
87+
retention-days: 1
88+
if-no-files-found: error
7589
build:
7690
name: Build OSS APK
7791
runs-on: namespace-profile-nekoyay
@@ -81,31 +95,22 @@ jobs:
8195
steps:
8296
- name: Checkout
8397
uses: actions/checkout@v5
84-
- name: Golang Status
85-
run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status
86-
- name: Libcore Status
87-
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
88-
- name: LibCore Cache
89-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
98+
- name: Download LibCore
99+
uses: actions/download-artifact@v5
90100
with:
91-
path: |
92-
app/libs/libcore.aar
93-
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
94-
- name: Sidecars Status
95-
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/masterdnsvpn.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
96-
- name: Sidecars Cache
97-
id: sidecars-cache
98-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
101+
name: libcore-aar-build
102+
path: app/libs
103+
- name: Download Sidecars
104+
uses: actions/download-artifact@v5
99105
with:
100-
path: |
101-
app/executableSo
102-
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.MDVPN_COMMIT }}-${{ env.NAIVE_VERSION }}-sidecars
106+
name: sidecars-so-build
107+
path: app/executableSo
103108
- name: Verify Sidecar Artifacts
104109
run: |
105110
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
106111
for so in libmieru.so libhysteria2.so libmasterdnsvpn.so libnaive.so; do
107112
if [ ! -f "app/executableSo/$abi/$so" ]; then
108-
echo "Error: missing app/executableSo/$abi/$so (sidecar cache miss)" >&2
113+
echo "Error: missing app/executableSo/$abi/$so (sidecar artifact missing)" >&2
109114
exit 1
110115
fi
111116
done

.github/workflows/ci.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ jobs:
4545
- name: Native Build
4646
if: steps.cache.outputs.cache-hit != 'true'
4747
run: ./run lib core
48+
- name: Upload LibCore
49+
uses: actions/upload-artifact@v5
50+
with:
51+
name: libcore-aar-ci
52+
path: app/libs/libcore.aar
53+
retention-days: 1
54+
if-no-files-found: error
4855
sidecars:
4956
name: Native Build (Sidecars)
5057
runs-on: namespace-profile-nekoyay
@@ -77,6 +84,13 @@ jobs:
7784
- name: Naive Download
7885
if: steps.cache.outputs.cache-hit != 'true'
7986
run: ./run lib naive
87+
- name: Upload Sidecars
88+
uses: actions/upload-artifact@v5
89+
with:
90+
name: sidecars-so-ci
91+
path: app/executableSo
92+
retention-days: 1
93+
if-no-files-found: error
8094
build:
8195
name: Build OSS APK
8296
runs-on: namespace-profile-nekoyay
@@ -91,31 +105,22 @@ jobs:
91105
with:
92106
distribution: 'temurin'
93107
java-version: '17'
94-
- name: Golang Status
95-
run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status
96-
- name: Libcore Status
97-
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
98-
- name: LibCore Cache
99-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
108+
- name: Download LibCore
109+
uses: actions/download-artifact@v5
100110
with:
101-
path: |
102-
app/libs/libcore.aar
103-
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}-ci
104-
- name: Sidecars Status
105-
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/masterdnsvpn.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
106-
- name: Sidecars Cache
107-
id: sidecars-cache
108-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
111+
name: libcore-aar-ci
112+
path: app/libs
113+
- name: Download Sidecars
114+
uses: actions/download-artifact@v5
109115
with:
110-
path: |
111-
app/executableSo
112-
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.MDVPN_COMMIT }}-${{ env.NAIVE_VERSION }}-sidecars-ci
116+
name: sidecars-so-ci
117+
path: app/executableSo
113118
- name: Verify Sidecar Artifacts
114119
run: |
115120
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
116121
for so in libmieru.so libhysteria2.so libmasterdnsvpn.so libnaive.so; do
117122
if [ ! -f "app/executableSo/$abi/$so" ]; then
118-
echo "Error: missing app/executableSo/$abi/$so (sidecar cache miss)" >&2
123+
echo "Error: missing app/executableSo/$abi/$so (sidecar artifact missing)" >&2
119124
exit 1
120125
fi
121126
done

.github/workflows/preview.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ jobs:
3636
- name: Native Build
3737
if: steps.cache.outputs.cache-hit != 'true'
3838
run: ./run lib core
39+
- name: Upload LibCore
40+
uses: actions/upload-artifact@v5
41+
with:
42+
name: libcore-aar-preview
43+
path: app/libs/libcore.aar
44+
retention-days: 1
45+
if-no-files-found: error
3946
sidecars:
4047
name: Native Build (Sidecars)
4148
runs-on: namespace-profile-nekoyay
@@ -68,6 +75,13 @@ jobs:
6875
- name: Naive Download
6976
if: steps.cache.outputs.cache-hit != 'true'
7077
run: ./run lib naive
78+
- name: Upload Sidecars
79+
uses: actions/upload-artifact@v5
80+
with:
81+
name: sidecars-so-preview
82+
path: app/executableSo
83+
retention-days: 1
84+
if-no-files-found: error
7185
build:
7286
name: Build OSS APK
7387
runs-on: namespace-profile-nekoyay
@@ -77,31 +91,22 @@ jobs:
7791
steps:
7892
- name: Checkout
7993
uses: actions/checkout@v5
80-
- name: Golang Status
81-
run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status
82-
- name: Libcore Status
83-
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
84-
- name: LibCore Cache
85-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
94+
- name: Download LibCore
95+
uses: actions/download-artifact@v5
8696
with:
87-
path: |
88-
app/libs/libcore.aar
89-
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
90-
- name: Sidecars Status
91-
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/masterdnsvpn.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
92-
- name: Sidecars Cache
93-
id: sidecars-cache
94-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
97+
name: libcore-aar-preview
98+
path: app/libs
99+
- name: Download Sidecars
100+
uses: actions/download-artifact@v5
95101
with:
96-
path: |
97-
app/executableSo
98-
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.MDVPN_COMMIT }}-${{ env.NAIVE_VERSION }}-sidecars
102+
name: sidecars-so-preview
103+
path: app/executableSo
99104
- name: Verify Sidecar Artifacts
100105
run: |
101106
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
102107
for so in libmieru.so libhysteria2.so libmasterdnsvpn.so libnaive.so; do
103108
if [ ! -f "app/executableSo/$abi/$so" ]; then
104-
echo "Error: missing app/executableSo/$abi/$so (sidecar cache miss)" >&2
109+
echo "Error: missing app/executableSo/$abi/$so (sidecar artifact missing)" >&2
105110
exit 1
106111
fi
107112
done

.github/workflows/release.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ jobs:
4242
- name: Native Build
4343
if: steps.cache.outputs.cache-hit != 'true'
4444
run: ./run lib core
45+
- name: Upload LibCore
46+
uses: actions/upload-artifact@v5
47+
with:
48+
name: libcore-aar-release
49+
path: app/libs/libcore.aar
50+
retention-days: 1
51+
if-no-files-found: error
4552
sidecars:
4653
name: Native Build (Sidecars)
4754
runs-on: namespace-profile-nekoyay
@@ -74,6 +81,13 @@ jobs:
7481
- name: Naive Download
7582
if: steps.cache.outputs.cache-hit != 'true'
7683
run: ./run lib naive
84+
- name: Upload Sidecars
85+
uses: actions/upload-artifact@v5
86+
with:
87+
name: sidecars-so-release
88+
path: app/executableSo
89+
retention-days: 1
90+
if-no-files-found: error
7791
build:
7892
name: Build OSS APK
7993
runs-on: namespace-profile-nekoyay
@@ -83,31 +97,22 @@ jobs:
8397
steps:
8498
- name: Checkout
8599
uses: actions/checkout@v5
86-
- name: Golang Status
87-
run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status
88-
- name: Libcore Status
89-
run: git ls-files libcore | xargs cat | sha1sum > libcore_status
90-
- name: LibCore Cache
91-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
100+
- name: Download LibCore
101+
uses: actions/download-artifact@v5
92102
with:
93-
path: |
94-
app/libs/libcore.aar
95-
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }}
96-
- name: Sidecars Status
97-
run: cat buildScript/lib/mieru.sh buildScript/lib/hysteria2.sh buildScript/lib/masterdnsvpn.sh buildScript/lib/naive.sh buildScript/init/env.sh buildScript/init/env_ndk.sh | sha1sum > sidecars_status
98-
- name: Sidecars Cache
99-
id: sidecars-cache
100-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
103+
name: libcore-aar-release
104+
path: app/libs
105+
- name: Download Sidecars
106+
uses: actions/download-artifact@v5
101107
with:
102-
path: |
103-
app/executableSo
104-
key: ${{ hashFiles('.github/workflows/*', 'sidecars_status') }}-${{ env.MIERU_VERSION }}-${{ env.HYSTERIA_VERSION }}-${{ env.MDVPN_COMMIT }}-${{ env.NAIVE_VERSION }}-sidecars
108+
name: sidecars-so-release
109+
path: app/executableSo
105110
- name: Verify Sidecar Artifacts
106111
run: |
107112
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
108113
for so in libmieru.so libhysteria2.so libmasterdnsvpn.so libnaive.so; do
109114
if [ ! -f "app/executableSo/$abi/$so" ]; then
110-
echo "Error: missing app/executableSo/$abi/$so (sidecar cache miss)" >&2
115+
echo "Error: missing app/executableSo/$abi/$so (sidecar artifact missing)" >&2
111116
exit 1
112117
fi
113118
done

0 commit comments

Comments
 (0)