|
1 | | -# This is a basic workflow to help you get started with Actions |
2 | | - |
| 1 | +--- |
3 | 2 | name: Build Kernel Package |
4 | 3 |
|
5 | | -# Controls when the action will run. |
| 4 | +# yamllint disable-line rule:truthy |
6 | 5 | on: |
7 | | - # Triggers the workflow on push or pull request events but only for the master branch |
8 | | - push: |
9 | | - branches: [ master ] |
10 | | - pull_request: |
11 | | - branches: [ master ] |
| 6 | + [push, pull_request] |
12 | 7 |
|
13 | | -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
14 | 8 | jobs: |
15 | | - # This workflow contains a single job called "build" |
16 | | - build: |
17 | | - # The type of runner that the job will run on |
18 | | - runs-on: ubuntu-latest |
| 9 | + lint: |
| 10 | + runs-on: ubuntu-20.04 |
| 11 | + steps: |
| 12 | + - name: 'Checkout repo' |
| 13 | + uses: actions/checkout@v2 |
| 14 | + - name: 'Set up Python 3.9' |
| 15 | + uses: actions/setup-python@v2 |
| 16 | + - name: 'Install dependencies' |
| 17 | + run: | |
| 18 | + python -m pip install --upgrade pip |
| 19 | + pip install yamllint |
| 20 | + sudo apt-get install shellcheck bash |
| 21 | + - name: 'Analysing the code' |
| 22 | + run: | |
| 23 | + yamllint . |
| 24 | + shellcheck ./*.sh |
19 | 25 |
|
20 | | - # Steps represent a sequence of tasks that will be executed as part of the job |
| 26 | + build: |
| 27 | + runs-on: ubuntu-20.04 |
21 | 28 | steps: |
22 | | - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
23 | | - - uses: actions/checkout@v2 |
| 29 | + - name: 'Checkout Repo' |
| 30 | + uses: actions/checkout@v2 |
24 | 31 |
|
25 | 32 | - name: Build script |
26 | 33 | id: build |
27 | 34 | run: | |
28 | 35 | mkdir /tmp/artifacts |
29 | 36 | VERSION=$(grep ^KERNEL_VERSION build.sh | head -n1| cut -d = -f2) |
30 | | - REL=$(grep "PKGREL=\d*" build.sh | cut -d = -f2) |
31 | | - #REL=$( git tag |grep -F $VERSION|sort -r|head -n1|tr -d v) |
| 37 | + REL=$(./next_version.sh mbp) |
32 | 38 | echo Building $VERSION-$REL |
33 | 39 | echo "::set-output name=tag::${VERSION}-${REL}" |
34 | 40 | sudo ./build.sh |
35 | 41 | cd /tmp/artifacts |
36 | 42 | ls -l |
37 | 43 | dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz |
38 | 44 | ls -l |
39 | | - |
| 45 | +
|
40 | 46 | - name: Upload package artifact |
| 47 | + if: github.ref == 'refs/heads/master' |
41 | 48 | uses: actions/upload-artifact@v2 |
42 | 49 | with: |
43 | | - name: linux-mbp-16x-wifi-${{ steps.build.outputs.tag }} |
| 50 | + name: linux-mbp-${{ steps.build.outputs.tag }} |
44 | 51 | path: /tmp/artifacts/* |
45 | 52 |
|
46 | 53 | - name: Release |
| 54 | + if: github.ref == 'refs/heads/master' |
47 | 55 | uses: softprops/action-gh-release@v1 |
48 | 56 | with: |
49 | 57 | files: | |
|
54 | 62 | draft: true |
55 | 63 | env: |
56 | 64 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
57 | | - |
|
0 commit comments