diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c44c5751..188dbf8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,12 +3,10 @@ name: ci on: push: branches: [main] - paths-ignore: - - "**.md" + paths-ignore: ['**.md'] pull_request: branches: [main] - paths-ignore: - - "**.md" + paths-ignore: ['**.md'] release: types: [published] @@ -17,7 +15,7 @@ jobs: name: ci strategy: matrix: - os: [ubuntu-20.04, macos-12] + os: [ubuntu-20.04, macos-12, macos-14] runs-on: ${{ matrix.os }} @@ -27,6 +25,7 @@ jobs: AMD64_LINUX_CLANG: amd64-linux-clang AMD64_WINDOWS_MINGW: amd64-windows-mingw AMD64_MACOSX_GCC: amd64-macosx-gcc + ARM64_MACOSX_GCC: arm64-macosx-gcc AMD64_FREEBSD_GCC: amd64-freebsd-gcc ARTIFACT_DIR: .artifacts ARTIFACT_RETENTION_DAYS: 5 @@ -36,13 +35,13 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') shell: bash run: | - TAG=$(echo $GITHUB_REF | cut -d '/' -f3) + TAG="$GITHUB_REF_NAME" echo "TAG: $TAG" if [[ $TAG == "v"* ]]; then TAG="${TAG:1}" fi echo "TAG: $TAG" - echo "TAG=$TAG" >> $GITHUB_ENV + echo "TAG=$TAG" >> "$GITHUB_ENV" - name: Checkout uses: actions/checkout@v4 @@ -54,7 +53,7 @@ jobs: sudo apt install -y mingw-w64 rpm alien nuget sudo apt remove -y jq - - name: Set up macOS + - name: Set up macOS (AMD64 and ARM64) if: runner.os == 'macOS' run: | brew install coreutils tree autoconf automake libtool @@ -125,7 +124,7 @@ jobs: ./scripts/ci-create-nuget-package.sh - name: Build on macOS (${{ env.AMD64_MACOSX_GCC }}) - if: runner.os == 'macOS' + if: matrix.os == 'macos-12' env: PREFIX: ${{ env.AMD64_MACOSX_GCC }} CC: gcc-11 @@ -136,6 +135,18 @@ jobs: ./scripts/ci-build.sh ./$PREFIX/bin/zsv version + - name: Build on macOS (${{ env.ARM64_MACOSX_GCC }}) + if: matrix.os == 'macos-14' + env: + PREFIX: ${{ env.ARM64_MACOSX_GCC }} + CC: gcc-11 + MAKE: make + RUN_TESTS: false + shell: bash + run: | + ./scripts/ci-build.sh + ./$PREFIX/bin/zsv version + # --- Upload build artifacts --- - name: Prepare build artifacts for upload @@ -230,7 +241,7 @@ jobs: if-no-files-found: error - name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_MACOSX_GCC }}.zip) - if: runner.os == 'macOS' + if: matrix.os == 'macos-12' uses: actions/upload-artifact@v4 env: ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_MACOSX_GCC }}.zip @@ -240,6 +251,17 @@ jobs: retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} if-no-files-found: error + - name: Upload (zsv-${{ env.TAG }}-${{ env.ARM64_MACOSX_GCC }}.zip) + if: matrix.os == 'macos-14' + uses: actions/upload-artifact@v4 + env: + ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.ARM64_MACOSX_GCC }}.zip + with: + name: ${{ env.ARTIFACT_NAME }} + path: ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }} + retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} + if-no-files-found: error + - name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_FREEBSD_GCC }}.zip) if: runner.os == 'Linux' uses: actions/upload-artifact@v4 @@ -285,7 +307,7 @@ jobs: if-no-files-found: error - name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_MACOSX_GCC }}.tar.gz) - if: runner.os == 'macOS' + if: matrix.os == 'macos-12' uses: actions/upload-artifact@v4 env: ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_MACOSX_GCC }}.tar.gz @@ -295,6 +317,17 @@ jobs: retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} if-no-files-found: error + - name: Upload (zsv-${{ env.TAG }}-${{ env.ARM64_MACOSX_GCC }}.tar.gz) + if: matrix.os == 'macos-14' + uses: actions/upload-artifact@v4 + env: + ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.ARM64_MACOSX_GCC }}.tar.gz + with: + name: ${{ env.ARTIFACT_NAME }} + path: ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }} + retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} + if-no-files-found: error + - name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_FREEBSD_GCC }}.tar.gz) if: runner.os == 'Linux' uses: actions/upload-artifact@v4 @@ -322,7 +355,7 @@ jobs: # --- Update homebrew tap --- - name: Update homebrew tap (liquidaty/homebrew-zsv) - if: ${{ startsWith(github.ref, 'refs/tags/v') && runner.os == 'macOS' }} + if: ${{ startsWith(github.ref, 'refs/tags/v') && matrix.os == 'macos-12' }} env: HOMEBREW_TAP_DEPLOY_KEY: ${{ secrets.HOMEBREW_TAP_DEPLOY_KEY }} TAG: ${{ env.TAG }}