|
| 1 | +name: AppImage build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + branches: 'v0.6' |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-appimage: |
| 10 | + |
| 11 | + runs-on: ubuntu-18.04 |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: Remove prev tag |
| 15 | + if: ${{ github.ref == 'refs/heads/ci' }} |
| 16 | + uses: actions/github-script@v3 |
| 17 | + with: |
| 18 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 19 | + script: | |
| 20 | + try { |
| 21 | + await github.git.deleteRef({ |
| 22 | + owner: context.repo.owner, |
| 23 | + repo: context.repo.repo, |
| 24 | + ref: "tags/continuous" |
| 25 | + }) |
| 26 | + } catch (e) { |
| 27 | + console.log("The continuous doesn't exist yet: " + e) |
| 28 | + } |
| 29 | + - uses: actions/checkout@v2 |
| 30 | + - name: Install apt dependencies |
| 31 | + run: | |
| 32 | + sudo apt-get install -yq --no-install-suggests --no-install-recommends \ |
| 33 | + build-essential libcap-dev libssl-dev python-all-dev \ |
| 34 | + debhelper dh-python python-stdeb |
| 35 | + - name: Build deb |
| 36 | + id: deb |
| 37 | + run: | |
| 38 | + python setup.py --command-packages=stdeb.command bdist_deb |
| 39 | + echo "::set-output name=asset_path::deb_dist/*.deb" |
| 40 | + - name: Build AppImage |
| 41 | + id: appimage |
| 42 | + run: | |
| 43 | + buildscripts/appimage.sh |
| 44 | + echo "::set-output name=asset_path::out/*.AppImage*" |
| 45 | + - name: Checksums |
| 46 | + run: | |
| 47 | + sha256sum ${{ steps.deb.outputs.asset_path }} >> checksum.txt |
| 48 | + sha256sum ${{ steps.appimage.outputs.asset_path }} >> checksum.txt |
| 49 | + cut -d '/' -f 2 checksum.txt >> body.txt |
| 50 | + cut -d ' ' -f 1 checksum.txt >> body.txt |
| 51 | + - name: Release Continuous |
| 52 | + if: ${{ github.ref == 'refs/heads/ci' }} |
| 53 | + uses: softprops/action-gh-release@master |
| 54 | + with: |
| 55 | + prerelease: true |
| 56 | + tag_name: continuous |
| 57 | + target_commitish: ${{ github.sha }} |
| 58 | + body_path: body.txt |
| 59 | + append_body: true |
| 60 | + files: | |
| 61 | + ${{ steps.deb.outputs.asset_path }} |
| 62 | + ${{ steps.appimage.outputs.asset_path }} |
| 63 | + env: |
| 64 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments