-
Notifications
You must be signed in to change notification settings - Fork 46
72 lines (61 loc) · 2.47 KB
/
create-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
name: Create Release
permissions:
contents: write
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Delete tag and release
uses: dev-drprasad/delete-tag-and-release@v1.0
with:
tag_name: new
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Filter and Create Release
id: create_release
run: |
# Build universal
zip AppStore.zip $(find . -type f \( -wholename "./*.json" -o -wholename "./Apps/*.yml" \))
# Build arm
[ -d "./Apps_arm" ] && cp -rfu ./Apps_arm/* ./Apps/
zip AppStore_arm.zip $(find . -type f -wholename "./*.json" && find . -type f -wholename "./Apps/*.yml" -exec grep -rlPz 'x-casaos:\s*\n\s*architectures:[\n\s\w-]*- arm\s*\n' {} \;)
git checkout -- ./Apps && git clean -df ./Apps
# Build arm64
[ -d "./Apps_arm64" ] && cp -rfu ./Apps_arm64/* ./Apps/
zip AppStore_arm64.zip $(find . -type f -wholename "./*.json" && find . -type f -wholename "./Apps/*.yml" -exec grep -rlPz 'x-casaos:\s*\n\s*architectures:[\n\s\w-]*- arm64\s*\n' {} \;)
git checkout -- ./Apps && git clean -df ./Apps
# Build amd64
[ -d "./Apps_amd64" ] && cp -rfu ./Apps_amd64/* ./Apps/
zip AppStore_amd64.zip $(find . -type f -wholename "./*.json" && find . -type f -wholename "./Apps/*.yml" -exec grep -rlPz 'x-casaos:\s*\n\s*architectures:[\n\s\w-]*- amd64\s*\n' {} \;)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload New Release
uses: softprops/action-gh-release@v1
with:
files: |
AppStore.zip
AppStore_arm.zip
AppStore_arm64.zip
AppStore_amd64.zip
tag_name: new
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to OSS
id: upload_to_oss
uses: tvrcgo/upload-to-oss@master
with:
key-id: ${{ secrets.OSS_KEY_ID }}
key-secret: ${{ secrets.OSS_KEY_SECRET }}
endpoint: ${{ secrets.OSS_ENDPOINT }}
bucket: ${{ secrets.OSS_BUCKET }}
assets: |
AppStore.zip:Cp0204-AppStore-Play.zip
AppStore_arm.zip:Cp0204-AppStore-Play-arm.zip
AppStore_arm64.zip:Cp0204-AppStore-Play-arm64.zip
AppStore_amd64.zip:Cp0204-AppStore-Play-amd64.zip