|
1 | | -name: Github CI build |
| 1 | +name: GitHub CI build |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | tags: |
6 | | - - '*' |
7 | | - pull_request: |
8 | | - branches: |
9 | | - - sailfishos |
10 | | - |
| 6 | + - 'v*' |
11 | 7 | env: |
12 | | - RELEASE: 4.5.0.16 |
| 8 | + # For available docker images, see https://github.com/CODeRUS/docker-sailfishos-platform-sdk |
| 9 | + OS_VERSION: 4.3.0.12 |
13 | 10 |
|
14 | 11 | jobs: |
15 | 12 | build: |
16 | 13 | runs-on: ubuntu-latest |
| 14 | + name: Build application |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + arch: ['i486', 'armv7hl', 'aarch64'] |
17 | 18 |
|
18 | 19 | steps: |
19 | | - - uses: actions/checkout@v2 |
| 20 | + - uses: actions/checkout@v3 |
20 | 21 |
|
21 | | - - name: Prepare |
22 | | - run: mkdir output |
23 | | - |
24 | | - - name: Build armv7hl |
25 | | - id: build_armv7hl |
26 | | - uses: coderus/github-sfos-build@master |
27 | | - with: |
28 | | - release: ${{ env.RELEASE }} |
29 | | - arch: armv7hl |
30 | | - |
31 | | - - name: Build aarch64 |
32 | | - id: build_aarch64 |
33 | | - uses: coderus/github-sfos-build@master |
34 | | - with: |
35 | | - release: ${{ env.RELEASE }} |
36 | | - arch: aarch64 |
37 | | - |
38 | | - |
39 | | - - name: Build i486 |
40 | | - id: build_i486 |
41 | | - uses: coderus/github-sfos-build@master |
42 | | - with: |
43 | | - release: ${{ env.RELEASE }} |
44 | | - arch: i486 |
45 | | - |
46 | | - - name: Upload build result |
47 | | - uses: actions/upload-artifact@v2 |
48 | | - with: |
49 | | - name: output-rpms |
50 | | - path: RPMS |
51 | | - |
52 | | - - name: Create release |
53 | | - if: contains(github.ref, 'release') |
| 22 | + - name: Build ${{ matrix.arch }} on ${{ OS_VERSION }} |
54 | 23 | run: | |
55 | 24 | set -x |
56 | | - assets=() |
57 | | - for asset in RPMS/*.rpm; do |
58 | | - assets+=("-a" "$asset") |
59 | | - done |
60 | | - tag_name="${GITHUB_REF##*/}" |
61 | | - hub release create "${assets[@]}" -m "$tag_name" "$tag_name" |
62 | | - env: |
63 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
64 | | - |
65 | | - |
| 25 | + mkdir -p output |
| 26 | + docker run --rm -v $PWD:/share coderus/sailfishos-platform-sdk:$OS_VERSION /bin/sh -xc ' |
| 27 | + mkdir -p build |
| 28 | + cd build |
| 29 | + cp -r /share/. . |
| 30 | + mb2 -t SailfishOS-$1-$2 build -d |
| 31 | + sudo cp -r RPMS/*.rpm /share/output/' sh_mb2 $OS_VERSION ${{ matrix.arch }} |
| 32 | + |
| 33 | + - name: Upload RPM (${{ matrix.arch }}) |
| 34 | + uses: actions/upload-artifact@v3 |
| 35 | + with: |
| 36 | + name: rpm-${{ matrix.arch }} |
| 37 | + path: output |
| 38 | + release: |
| 39 | + name: Release |
| 40 | + if: startsWith(github.ref, 'refs/tags/v') |
| 41 | + needs: |
| 42 | + - build |
| 43 | + runs-on: ubuntu-latest |
| 44 | + steps: |
| 45 | + - name: Download armv7hl |
| 46 | + uses: actions/download-artifact@v3 |
| 47 | + with: |
| 48 | + name: rpm-armv7hl |
| 49 | + continue-on-error: true |
| 50 | + - name: Download aarch64 |
| 51 | + uses: actions/download-artifact@v3 |
| 52 | + with: |
| 53 | + name: rpm-aarch64 |
| 54 | + continue-on-error: true |
| 55 | + - name: Download i486 |
| 56 | + uses: actions/download-artifact@v3 |
| 57 | + with: |
| 58 | + name: rpm-i486 |
| 59 | + continue-on-error: true |
| 60 | + - name: Extract Version Name |
| 61 | + id: extract_name |
| 62 | + uses: actions/github-script@v4 |
| 63 | + with: |
| 64 | + result-encoding: string |
| 65 | + script: | |
| 66 | + return context.payload.ref.replace(/refs\/tags\//, ''); |
| 67 | + - name: Create a Release |
| 68 | + uses: softprops/action-gh-release@v1 |
| 69 | + env: |
| 70 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 71 | + with: |
| 72 | + name: ${{ steps.extract_name.outputs.result }} |
| 73 | + draft: false |
| 74 | + prerelease: false |
| 75 | + body: This release was autogenerated. |
| 76 | + files: '*.rpm' |
0 commit comments