diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8ae5d73..5c15d01 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,7 +60,7 @@ jobs: echo "REF_TYPE: $REF_TYPE" echo "REF_NAME: $REF_NAME" echo "FMO_BUILD_VERSION: $FMO_BUILD_VERSION" - echo "FMO_BUILD_VERSION=$FMO_BUILD_VERSION" >> "$GITHUB_ENV" + #echo "FMO_BUILD_VERSION=$FMO_BUILD_VERSION" >> "$GITHUB_ENV" echo "FMO_BUILD_VERSION=$FMO_BUILD_VERSION" >> "$GITHUB_OUTPUT" - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main @@ -78,6 +78,7 @@ jobs: docker-images: true swap-storage: true - name: Install Nix + id: install-nix uses: cachix/install-nix-action@v30 with: nix_path: nixpkgs=channel:nixos-unstable @@ -88,17 +89,22 @@ jobs: trusted-substituters = https://cache.nixos.org https://nixpkgs.cachix.org https://nixpkgs-unfree.cachix.org https://nix-community.cachix.org trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixpkgs.cachix.org-1:q91R6hxbwFvDqTSDKwDAV4T5PxqXGxswD8vhONFMeOE= nixpkgs-unfree.cachix.org-1:hqvoInulhbV4nJ9yJOEr+4wxhDV4xq2d1DK7S6Nj6rs= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= - name: Setup Cachix + id: setup-cachix uses: cachix/cachix-action@v15 with: name: fmo-os authToken: '${{ secrets.CACHIX_TOKEN }}' - name: Prepare build environment + id: prepare-build env: SSH_AUTH_SOCK: /tmp/ssh_agent.sock run: | - SSH_DIR=$HOME/.ssh + echo "Configure Git" + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" - echo "Create SSH directory" + echo "Configure SSH" + SSH_DIR=$HOME/.ssh mkdir -p $SSH_DIR chmod 0700 $SSH_DIR @@ -111,23 +117,22 @@ jobs: chmod 600 $SSH_DIR/id_rsa ssh-agent -a $SSH_AUTH_SOCK > /dev/null ssh-add $SSH_DIR/id_rsa - - git config --global user.email "actions@github.com" - git config --global user.name "GitHub Actions" - name: Build + id: build + env: + FMO_BUILD_VERSION: "${{ steps.fmo-build-version.outputs.FMO_BUILD_VERSION }}" run: | nix flake show cachix watch-exec fmo-os -- nix build -L --accept-flake-config .#fmo-os-installer-debug - ls -la - #- name: Build - # id: build - # uses: ./.github/actions/build-action - # env: - # FMO_BUILD_VERSION: "${{ steps.fmo-build-version.outputs.BUILD_VERSION }}" - # with: - # BUILD_TARGET: "fmo-os-installer-debug" - # CACHIX_TOKEN: ${{ secrets.CACHIX_TOKEN }} - # RA_TOKEN: ${{ secrets.RA_TOKEN }} + + if ! [[ -f ./result/iso/nixos.iso ]]; then + echo "No output image found, build failed!" >&2 + exit 1 + fi + + output="$(readlink -f ./result/iso/nixos.iso)" + echo "Output image: $output" + echo "OUTPUT_IMAGE=$output" >> "$GITHUB_OUTPUT" #- name: Push to JFrog artifactory # uses: ./.github/actions/upload-action-jfrog # with: