|
| 1 | +name: "Build ISO" |
| 2 | +on: |
| 3 | + push: |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize, reopened] |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + strategy: |
| 10 | + fail-fast: false |
| 11 | + matrix: |
| 12 | + plattform: [x86_64-linux] |
| 13 | + include: |
| 14 | + - plattform: x86_64-linux |
| 15 | + type: iso |
| 16 | + attrPath: config.system.build.isoImage |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v3 |
| 20 | + - uses: cachix/install-nix-action@v23 |
| 21 | + with: |
| 22 | + nix_path: nixpkgs=channel:nixos-23.05 |
| 23 | + extra_nix_config: | |
| 24 | + system-features = aarch64-linux arm-linux |
| 25 | + - run: | |
| 26 | + DEBIAN_FRONTEND=noninteractive |
| 27 | + sudo apt-get update -q -y && sudo apt-get install -q -y tree qemu-system-aarch64 qemu-efi binfmt-support qemu-user-static |
| 28 | + - run: nix-build '<nixpkgs/nixos>' -A ${{ matrix.attrPath }} -I nixos-config=${{ matrix.type }}.nix --argstr system ${{ matrix.plattform }} |
| 29 | + - run: tree result |
| 30 | + - uses: actions/upload-artifact@v3 |
| 31 | + with: |
| 32 | + name: ${{ matrix.plattform }}-${{ matrix.type }} |
| 33 | + path: result/${{ matrix.type }}/ |
| 34 | + if-no-files-found: error |
| 35 | + retention-days: 5 |
| 36 | + |
| 37 | + |
| 38 | + create_release: |
| 39 | + runs-on: ubuntu-latest |
| 40 | + needs: |
| 41 | + - build |
| 42 | + if: startsWith(github.ref, 'refs/tags/v') |
| 43 | + permissions: |
| 44 | + contents: write |
| 45 | + steps: |
| 46 | + - name: Download all artifacts |
| 47 | + uses: actions/download-artifact@v3 |
| 48 | + - name: Display structure of artifacts |
| 49 | + run: ls -R |
| 50 | + - name: Create Release & Upload Release Assets |
| 51 | + uses: softprops/action-gh-release@v1 |
| 52 | + with: |
| 53 | + # Note: If there is no release name specified, releases created in |
| 54 | + # the GitHub UI do not trigger a failure and are modified instead. |
| 55 | + draft: false |
| 56 | + prerelease: false |
| 57 | + # Note: Release notes are only auto-generated if the release was |
| 58 | + # created by the Github Action and was not created in the Github UI. |
| 59 | + generate_release_notes: true |
| 60 | + files: | |
| 61 | + ./*/*.iso |
0 commit comments