|
| 1 | +name: GitHub CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths-ignore: |
| 6 | + - '.github/*' |
| 7 | + - '.github/*_TEMPLATE/**' |
| 8 | + - '*.md' |
| 9 | + - '*.yml' |
| 10 | + pull_request: |
| 11 | + paths-ignore: |
| 12 | + - '.github/*' |
| 13 | + - '.github/*_TEMPLATE/**' |
| 14 | + - '*.md' |
| 15 | + - '*.yml' |
| 16 | + workflow_dispatch: |
| 17 | + |
| 18 | +jobs: |
| 19 | + build: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + steps: |
| 22 | + - name: Checkout nxdk |
| 23 | + uses: actions/checkout@v2 |
| 24 | + with: |
| 25 | + repository: XboxDev/nxdk |
| 26 | + submodules: recursive |
| 27 | + - name: Set xbox_kernel_test_suite dir |
| 28 | + id: xkts |
| 29 | + run: echo "::set-output name=dir::projects/xbox_kernel_test_suite" |
| 30 | + - name: Checkout xbox_kernel_test_suite |
| 31 | + uses: actions/checkout@v2 |
| 32 | + with: |
| 33 | + path: ${{ steps.xkts.outputs.dir }} |
| 34 | + - name: Install dependencies |
| 35 | + run: | |
| 36 | + sudo apt-get -y update |
| 37 | + sudo apt-get -y install lld llvm |
| 38 | + - name: Build |
| 39 | + working-directory: ${{ steps.xkts.outputs.dir }} |
| 40 | + run: make -j$(nproc) |
| 41 | + - name: Set artifact + release parameters |
| 42 | + id: parameters |
| 43 | + run: | |
| 44 | + export file=default.xbe |
| 45 | + echo "::set-output name=name::$file" |
| 46 | + echo "::set-output name=path::${{ steps.xkts.outputs.dir }}/bin/$file" |
| 47 | + echo "::set-output name=tag::$(date +'%Y%m%d%H%M%S')-${GITHUB_SHA:0:7}" |
| 48 | + - uses: actions/upload-artifact@v2 |
| 49 | + with: |
| 50 | + name: ${{ steps.parameters.outputs.name }} |
| 51 | + path: ${{ steps.parameters.outputs.path }} |
| 52 | + if-no-files-found: error |
| 53 | + - name: Create release |
| 54 | + if: | |
| 55 | + github.event.action != 'pull_request' && |
| 56 | + github.ref == 'refs/heads/master' && |
| 57 | + github.repository == 'Cxbx-Reloaded/xbox_kernel_test_suite' |
| 58 | + env: |
| 59 | + GH_REPO: ${{ github.repository }} # https://github.com/cli/cli/issues/3556 |
| 60 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + run: gh release create ${{ steps.parameters.outputs.tag }} ${{ steps.parameters.outputs.path }} --target $GITHUB_SHA |
0 commit comments