-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (127 loc) · 4.8 KB
/
wsl.yaml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Build WSL
on:
workflow_dispatch:
inputs:
upload:
description: 'Should we upload the appxbundle to the store'
required: false
default: 'no'
releases:
description: 'release to be built'
required: false
default: '[22.03, 20.03, 23.03, 22.09]'
push:
branches: [ "master" ]
concurrency: build-wsl
env:
archs: "x64 ARM64"
workDir: 'C:/Temp/builddir'
jobs:
build-rootfs:
uses: ./.github/workflows/rootfs.yaml
build-wsl:
needs: build-rootfs
name: Build openEuler ${{ matrix.release }} app
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
release: ${{ fromJSON(github.event.inputs.releases)}}
steps:
- name: Checkout code
shell: bash
run: |
mkdir -p ${{ env.workDir }}
git clone ${{ github.server_url }}/${{ github.repository }} ${{ env.workDir }}
cd ${{ env.workDir }}
git checkout "${GITHUB_SHA}"
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Download artifact
uses: actions/download-artifact@v2
with:
path: ${{ env.workDir }}
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: install deps
working-directory: ${{ env.workDir }}
shell: bash
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: set env
working-directory: ${{ env.workDir }}
shell: bash
run: |
# make 22.03 to 2203
r=$(echo "${{ matrix.release }}"|sed 's/\.//')
sp=$(python3 get_sp_version.py ${{ matrix.release }})
version=$(echo $sp.${{ github.run_number }})
echo "version=$version" >> $GITHUB_ENV
python3 custom.py -r ${{ matrix.release }} -v $version
- name: show and prepare artifact
working-directory: ${{ env.workDir }}
shell: bash
run: |
read -ra archs <<< "${{ env.archs }}"
for arch in ${archs[@]};do
if [ $arch == "x64" ];then
targetarch=x86_64
elif [ $arch == 'ARM64' ];then
targetarch=aarch64
fi
mkdir -vp $arch
mv -v openeuler-${{ matrix.release }}-$targetarch-wsl-rootfs.tar/openeuler-${{ matrix.release }}-$targetarch-wsl-rootfs.tar.gz $arch/install.tar.gz
done
targets=$(echo ${{ env.archs }}|sed 's/ /|/g')
echo "targets=$targets" >> $GITHUB_ENV
rm -rf openeuler-*-wsl-rootfs.tar
ls -lh **
# Decode the Base64 encoded Pfx
- name: Decode the Pfx
run: |
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate\certificate.txt -Value '${{ secrets.SIGN_CERT }}'
certutil -decode certificate\certificate.txt certificate\certificate.pfx
Import-PfxCertificate -CertStoreLocation Cert:LocalMachine\Trust -FilePath certificate\certificate.pfx
Import-PfxCertificate -CertStoreLocation Cert:CurrentUser\My -FilePath certificate\certificate.pfx
- name: Build Bundle
working-directory: ${{ env.workDir }}
shell: powershell
run: |
.\build.bat clean
- name: copy assets
working-directory: ${{ env.workDir }}
shell: bash
run: |
cp -v meta/${{ matrix.release }}/${{ matrix.release }}.PNG AppPackages/DistroLauncher-Appx/
- name: Allow downloading sideload appxbundle
uses: actions/upload-artifact@v2
with:
name: sideload-openeuler-${{ matrix.release }}
path: ${{ env.workDir }}/AppPackages/DistroLauncher-Appx/DistroLauncher-Appx_*/*
- name: Allow downloading store appxupload
uses: actions/upload-artifact@v2
with:
name: storeupload-openeuler-${{ matrix.release }}
path: |
${{ env.workDir }}/AppPackages/DistroLauncher-Appx/DistroLauncher-Appx_*.appxupload
${{ env.workDir }}/AppPackages/DistroLauncher-Appx/*.PNG
- name: show zip files
working-directory: ${{ env.workDir }}/AppPackages/DistroLauncher-Appx
shell: bash
run: |
ls -lh **
- name: Archive Release
uses: thedoctor0/zip-release@main
with:
directory: ${{ env.workDir }}/AppPackages/DistroLauncher-Appx
type: 'zip'
filename: 'app.zip'
exclusions: 'DistroLauncher-Appx_*_Test'
- name: upload to store
if: ${{ github.event.inputs.upload == 'yes' }}
working-directory: ${{ env.workDir }}
shell: bash
run: |
python3 submit.py -c ${{ secrets.AZURE_AD_CLIENT_ID }} -t ${{ secrets.AZURE_AD_TENANT_ID }} -k ${{ secrets.AZURE_AD_APP_KEY }} -r "${{ matrix.release }}" -f AppPackages/DistroLauncher-Appx/app.zip