name: Build 🏗️ and Publish 📀 on: push: tags: ['*'] jobs: create-release: name: Create Release runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: Create release ${{ github.ref }} as a draft env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh release create "${{ github.ref }}" --draft --generate-notes build-console-iso: needs: [create-release] name: Console ISO runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - uses: DeterminateSystems/nix-installer-action@v9 - uses: DeterminateSystems/magic-nix-cache-action@v2 - name: Build Console ISO run: | nix build .#nixosConfigurations.iso-console.config.system.build.isoImage mkdir iso || true ISO=$(head -n1 result/nix-support/hydra-build-products | cut -d'/' -f6) sudo mv "result/iso/${ISO}" iso/console-${ISO} sha256sum "iso/console-${ISO}" > "iso/console-${ISO}.sha256" sed -i -r "s/ .*\/(.+)/ \1/g" "iso/console-${ISO}.sha256" - name: Upload Console ISO env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | for artefact in "iso/"*; do gh release upload "${{ github.ref }}" "${artefact}" --clobber done build-desktop-iso: needs: [create-release] name: Desktop ISO runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - uses: DeterminateSystems/nix-installer-action@v9 - uses: DeterminateSystems/magic-nix-cache-action@v2 - name: Build Desktop ISO run: | nix build .#nixosConfigurations.iso-desktop.config.system.build.isoImage mkdir iso || true ISO=$(head -n1 result/nix-support/hydra-build-products | cut -d'/' -f6) sudo mv "result/iso/${ISO}" iso/desktop-${ISO} sha256sum "iso/desktop-${ISO}" > "iso/desktop-${ISO}.sha256" sed -i -r "s/ .*\/(.+)/ \1/g" "iso/desktop-${ISO}.sha256" - name: Upload Desktop ISO env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | for artefact in "iso/"*; do gh release upload "${{ github.ref }}" "${artefact}" --clobber done publish-release: name: Publish Release needs: [build-console-iso, build-desktop-iso] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: Publish release ${{ github.ref }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | if [ "$(gh release view "${{ github.ref }}" --json assets --template '{{len .assets}}')" -lt 0 ]; then exit 1 fi gh release edit "${{ github.ref }}" --draft=false