|
| 1 | +name: Build AltServer |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + |
| 6 | +env: |
| 7 | + REGISTRY: ghcr.io |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + builder: [ghcr.io/nyamisty/altserver_builder_alpine_armv7, ghcr.io/nyamisty/altserver_builder_alpine_aarch64, ghcr.io/nyamisty/altserver_builder_alpine_amd64, ghcr.io/nyamisty/altserver_builder_alpine_i386] |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v2 |
| 18 | + with: |
| 19 | + ref: master # set the branch to merge to |
| 20 | + fetch-depth: 0 |
| 21 | + submodules: recursive |
| 22 | + - |
| 23 | + name: Set up QEMU |
| 24 | + uses: docker/setup-qemu-action@v1 |
| 25 | + - name: Log in to the Container registry |
| 26 | + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 |
| 27 | + with: |
| 28 | + registry: ${{ env.REGISTRY }} |
| 29 | + username: ${{ github.actor }} |
| 30 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 31 | + - name: Prepare build |
| 32 | + run: mkdir /tmp/build_output |
| 33 | + - name: Build |
| 34 | + run: | |
| 35 | + image=${{ matrix.builder }} |
| 36 | + docker pull $image |
| 37 | + docker run -v ${PWD}:/workdir -w /workdir $image make NO_USBMUXD_STUB=1 NO_UPNP_STUB=1 -j3 |
| 38 | + mv AltServer-* /tmp/build_output |
| 39 | + git clean -fdX |
| 40 | + - name: Upload to github artifact |
| 41 | + uses: NyaMisty/upload-artifact-as-is@master |
| 42 | + with: |
| 43 | + path: /tmp/build_output |
| 44 | + |
| 45 | + release: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + needs: [build] |
| 48 | + name: "release" |
| 49 | + steps: |
| 50 | + - name: "Create artifact directory" |
| 51 | + run: | |
| 52 | + mkdir -p build_output |
| 53 | + - name: "Download all artifacts" |
| 54 | + uses: actions/download-artifact@v2 |
| 55 | + with: |
| 56 | + path: build_output |
| 57 | + - name: "Rearrange artifacts" |
| 58 | + run: | |
| 59 | + find build_output |
| 60 | + mkdir -p build_release |
| 61 | + mv build_output/*/* build_release |
| 62 | + ls build_release |
| 63 | + if [ "$(ls -A build_release)" ]; then exit 0; else exit 1; fi |
| 64 | + - name: Release |
| 65 | + uses: softprops/action-gh-release@v1 |
| 66 | + if: ${{ startsWith(github.ref, 'refs/tags/') }} |
| 67 | + with: |
| 68 | + files: build_release/* |
| 69 | + env: |
| 70 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 71 | + |
0 commit comments