|
1 | 1 | name: CI |
2 | 2 |
|
3 | | -on: [push, workflow_dispatch] |
| 3 | +on: |
| 4 | + release: |
| 5 | + # this runs CI only when a release is created at first (and not when it is |
| 6 | + # edited or published) |
| 7 | + types: [created] |
| 8 | + |
| 9 | + push: |
| 10 | + branches: main |
| 11 | + |
| 12 | + pull_request: |
| 13 | + branches: main |
| 14 | + |
| 15 | + workflow_dispatch |
4 | 16 |
|
5 | 17 | jobs: |
6 | 18 | build: |
7 | 19 | runs-on: ubuntu-latest |
| 20 | + |
8 | 21 | steps: |
9 | 22 | - uses: actions/checkout@v1 |
10 | | - - name: python-wasm-builder prepare |
| 23 | + |
| 24 | + - name: Display CI properties |
11 | 25 | run: | |
12 | | - WD=$(pwd) |
13 | | - python3 -V |
14 | | - echo $WD |
15 | | - clang --version | head -n 1 |
16 | | - echo |
17 | | - gcc --version | head -n 1 |
18 | | - echo |
19 | | - env|grep GITHUB |
20 | | - echo |
21 | | - grep "^Pkg.Revision =" ${ANDROID_HOME}/ndk-bundle/source.properties |
22 | | - sudo apt-get update |
23 | | - # git clang libffi-dev libssl-dev zlib1g-dev libncursesw5-dev make |
24 | | - sudo apt-get install -y bash wget |
25 | | - cd $GITHUB_WORKSPACE |
26 | | - time bash ./python-wasm-sdk.sh |
27 | | -
|
28 | | - - name: Package SDK |
| 26 | + WD=$(pwd) |
| 27 | + python3 -V |
| 28 | + echo $WD |
| 29 | + clang --version | head -n 1 |
| 30 | + echo |
| 31 | + gcc --version | head -n 1 |
| 32 | + echo |
| 33 | + env|grep GITHUB |
| 34 | + echo |
| 35 | + grep "^Pkg.Revision =" ${ANDROID_HOME}/ndk-bundle/source.properties |
| 36 | + |
| 37 | + - name: Install dependencies |
| 38 | + run: | |
| 39 | + sudo apt-get update --fix-missing |
| 40 | + # git clang libffi-dev libssl-dev zlib1g-dev libncursesw5-dev make |
| 41 | + sudo apt-get install -y bash wget |
| 42 | +
|
| 43 | + - name: Build sdk |
| 44 | + run: bash ./python-wasm-sdk.sh |
| 45 | + |
| 46 | + - name: Upload sdk to Github artifacts |
29 | 47 | uses: actions/upload-artifact@v2 |
30 | 48 | with: |
31 | | - name: sdk |
32 | | - path: /home/runner/work/python-wasm-sdk/python-wasm-sdk/sdk |
| 49 | + path: ./sdk |
| 50 | + |
| 51 | + - name: Upload sdk to Github Releases |
| 52 | + if: github.event_name == 'release' |
| 53 | + uses: svenstaro/upload-release-action@v2.2.1 |
| 54 | + with: |
| 55 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 56 | + file: ./sdk/* |
| 57 | + file_glob: true |
| 58 | + tag: ${{ github.ref }} |
0 commit comments