From 0f6ef9cf2ce064c6fe1decf01fb9ca8ca51769cd Mon Sep 17 00:00:00 2001 From: KtorZ Date: Sun, 21 Jul 2024 18:25:08 +0200 Subject: [PATCH] Tag build archives appropriately + use 'macos' instead of 'osx'. --- .github/workflows/build.yaml | 13 ++++++++++--- Makefile | 6 +++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 55a515e..6d7b00f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,11 +14,11 @@ jobs: build: strategy: matrix: - os: [ linux, osx ] + os: [ linux, macos ] arch: [ x86_64, aarch64 ] compiler: [ ghc948 ] exclude: - - os: osx + - os: macos arch: x86_64 runs-on: ${{ matrix.arch == 'x86_64' && 'ubuntu-latest' || (matrix.os == 'linux' && 'buildjet-4vcpu-ubuntu-2204-arm' || 'macos-latest') }} @@ -29,6 +29,13 @@ jobs: with: submodules: true + - name: Tag build artifacts + id: tag + run: + echo "value=$VALUE" >> $GITHUB_OUTPUT + env: + VALUE: ${{ startsWith(github.ref, 'refs/tags') && "${GITHUB_REF/refs\/tags\//}" || github.sha) }} + - name: ❄️ Install Nix uses: cachix/install-nix-action@v22 with: @@ -66,7 +73,7 @@ jobs: - name: 📎 Upload Artifact uses: actions/upload-artifact@v3 with: - name: kupo-${{ github.sha }}-${{ matrix.arch }}-${{ matrix.os }} + name: kupo-${{ steps.tag.outputs.value }}-${{ matrix.arch }}-${{ matrix.os }} path: | dist/bin dist/share diff --git a/Makefile b/Makefile index 40b5e07..fb230a5 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ STYLISH_HASKELL_VERSION := 0.14.5.0 # Default network for snapshots. NETWORK := preview -OS := $(shell uname -s | sed 's/Linux/linux/' | sed 's/Darwin/osx/') +OS := $(shell uname -s | sed 's/Linux/linux/' | sed 's/Darwin/macos/') ARCH := $(shell uname -m | sed 's/X86/x86_64/' | sed 's/arm64/aarch64/') NIX_GHC := $(shell echo $(GHC) | sed 's/^\([0-9]\)\.\([0-9]\)\..*/\1\2/') NIX_SHELL := github:CardanoSolutions/devx\#ghc$(NIX_GHC)-static-minimal-iog @@ -53,7 +53,7 @@ $(OUT)/share/kupo/LICENSE: $(BIN_DIR_PATH)/kupo: @nix develop $(NIX_SHELL) $(NIX_OPTS) --command bash -c "cabal build kupo:exe:kupo $(PG_FLAG)" -ifeq ($(OS),osx) +ifeq ($(OS),macos) @scripts/patch-nix-deps.sh $@ endif @@ -70,7 +70,7 @@ $(OUT)/lib: .SILENT: doc clean clean-all configure: # Freeze projet dependencies and update package index -ifeq ($(OS),osx) +ifeq ($(OS),macos) nix develop $(NIX_SHELL) $(NIX_OPTS) --command bash -c "cat /nix/store/l0np941gvmpqcgxankbgb7zpl4mj332v-cabal.project.local >> cabal.project.local" else ifeq ($(ARCH),x86_64)