Sql dup colname bug #2180
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' | |
| - 'setup-action/**' | |
| - '.github/workflows/setup-action.yml' | |
| - '.github/workflows/codeql.yml' | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' | |
| - 'setup-action/**' | |
| - '.github/workflows/setup-action.yml' | |
| - '.github/workflows/codeql.yml' | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| wsl: | |
| description: 'Enable WSL job' | |
| required: false | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: write | |
| id-token: write | |
| attestations: write | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| AMD64_LINUX_MUSL: amd64-linux-musl | |
| AMD64_WINDOWS_MINGW: amd64-windows-mingw | |
| AMD64_FREEBSD_GCC: amd64-freebsd-gcc | |
| ARTIFACT_DIR: .artifacts | |
| ARTIFACT_RETENTION_DAYS: 5 | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| tag: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| TAG: ${{ steps.tag.outputs.TAG }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| sparse-checkout: | | |
| scripts/ci-set-tag-output-parameter.sh | |
| - name: Set TAG output parameter | |
| id: tag | |
| env: | |
| TAG: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || '' }} | |
| run: ./scripts/ci-set-tag-output-parameter.sh | |
| clang-format: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Run clang-format | |
| run: | | |
| sudo ln -sf /usr/bin/clang-format-15 /usr/bin/clang-format | |
| ./scripts/ci-run-clang-format.sh | |
| cppcheck: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install apt dependencies | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: cppcheck | |
| - name: Run cppcheck | |
| run: ./scripts/ci-run-cppcheck.sh | |
| - name: Upload (${{ env.CPPCHECK_XML_ARTIFACT_NAME }}) | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ env.CPPCHECK_XML_ARTIFACT_NAME }} | |
| path: ${{ env.CPPCHECK_XML_ARTIFACT_NAME }} | |
| retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} | |
| if-no-files-found: error | |
| - name: Upload (${{ env.CPPCHECK_HTML_ARTIFACT_NAME }}) | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ env.CPPCHECK_HTML_ARTIFACT_NAME }} | |
| path: ${{ env.CPPCHECK_HTML_ARTIFACT_NAME }} | |
| retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} | |
| if-no-files-found: error | |
| shellcheck: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Run shellcheck | |
| run: ./scripts/ci-run-shellcheck.sh | |
| ci-linux: | |
| needs: [tag, clang-format, cppcheck, shellcheck] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| prefix: amd64-linux-gcc | |
| cc: gcc | |
| - os: ubuntu-22.04 | |
| prefix: amd64-linux-clang | |
| cc: clang | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| env: | |
| TAG: ${{ needs.tag.outputs.TAG }} | |
| outputs: | |
| TAG: ${{ needs.tag.outputs.TAG }} | |
| steps: | |
| - name: Install apt dependencies | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: rpm alien tmux | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Test | |
| env: | |
| PREFIX: ${{ matrix.prefix }} | |
| CC: ${{ matrix.cc }} | |
| MAKE: make | |
| RUN_TESTS: true | |
| SKIP_BUILD: true | |
| run: | | |
| ./scripts/ci-build.sh | |
| - name: Build | |
| env: | |
| PREFIX: ${{ matrix.prefix }} | |
| CC: ${{ matrix.cc }} | |
| CFLAGS: -DPREFIX=\"\" | |
| MAKE: make | |
| RUN_TESTS: false | |
| SKIP_BUILD: false | |
| run: | | |
| ./scripts/ci-build.sh | |
| ./scripts/ci-create-debian-package.sh | |
| ./scripts/ci-create-rpm-package.sh | |
| - name: Prepare build artifacts for upload | |
| run: ./scripts/ci-prepare-artifacts-for-upload.sh | |
| - name: Attest build artifacts for release | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| uses: actions/attest-build-provenance@v4 | |
| with: | |
| subject-path: ${{ env.ARTIFACT_DIR }}/* | |
| - name: Verify attestations of release artifacts | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: ./scripts/ci-verify-attestations.sh | |
| - name: Upload (zsv-${{ env.TAG }}-${{ matrix.prefix }}.zip) | |
| uses: actions/upload-artifact@v7 | |
| env: | |
| ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ matrix.prefix }}.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 }}-${{ matrix.prefix }}.deb) | |
| uses: actions/upload-artifact@v7 | |
| env: | |
| ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ matrix.prefix }}.deb | |
| 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 }}-${{ matrix.prefix }}.rpm) | |
| uses: actions/upload-artifact@v7 | |
| env: | |
| ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ matrix.prefix }}.rpm | |
| 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 }}-${{ matrix.prefix }}.tar.gz) | |
| uses: actions/upload-artifact@v7 | |
| env: | |
| ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ matrix.prefix }}.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 release artifacts | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: ./scripts/ci-upload-release-artifacts.sh | |
| prepare-linux-packages: | |
| if: ${{ github.ref_name == 'main' || startsWith(github.ref, 'refs/tags/v') }} | |
| needs: [ci-linux] | |
| runs-on: ubuntu-latest | |
| env: | |
| TAG: ${{ needs.ci-linux.outputs.TAG }} | |
| AMD64_ZIP: zsv-${{ needs.ci-linux.outputs.TAG }}-amd64-linux-gcc.zip | |
| steps: | |
| - name: Install apt dependencies | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: rpm dpkg-dev createrepo-c | |
| - name: Install fpm gem | |
| run: sudo gem install --no-document fpm | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| sparse-checkout: | | |
| .fpm | |
| scripts/ci-prepare-deb-rpm-repos.sh | |
| - name: Download ${{ env.AMD64_ZIP }} | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ${{ env.AMD64_ZIP }} | |
| path: ${{ env.ARTIFACT_DIR }} | |
| - name: Prepare DEB and RPM package repos | |
| run: ./scripts/ci-prepare-deb-rpm-repos.sh | |
| - name: Upload packages artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: packages | |
| path: ${{ env.ARTIFACT_DIR }}/packages | |
| ci-macos: | |
| needs: [tag, clang-format, cppcheck, shellcheck] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-15-intel | |
| prefix: amd64-macosx-gcc | |
| gcc: gcc-13 | |
| - os: macos-latest | |
| prefix: arm64-macosx-gcc | |
| gcc: gcc-13 | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| outputs: | |
| TAG: ${{ needs.tag.outputs.TAG }} | |
| env: | |
| TAG: ${{ needs.tag.outputs.TAG }} | |
| ZIP: zsv-${{ needs.tag.outputs.TAG }}-${{ matrix.prefix }}.zip | |
| TAR: zsv-${{ needs.tag.outputs.TAG }}-${{ matrix.prefix }}.tar.gz | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up homebrew dependencies | |
| run: brew install --quiet coreutils tree tmux sqlite3 | |
| - name: Test | |
| env: | |
| PREFIX: ${{ matrix.prefix }} | |
| CC: ${{ matrix.gcc }} | |
| MAKE: make | |
| RUN_TESTS: true | |
| SKIP_BUILD: true | |
| run: ./scripts/ci-build.sh | |
| - name: Build | |
| env: | |
| PREFIX: ${{ matrix.prefix }} | |
| CC: ${{ matrix.gcc }} | |
| CFLAGS: -DPREFIX=\"\" | |
| MAKE: make | |
| RUN_TESTS: false | |
| SKIP_BUILD: false | |
| run: ./scripts/ci-build.sh | |
| - name: Prepare build artifacts for upload | |
| run: ./scripts/ci-prepare-artifacts-for-upload.sh | |
| - name: Codesign and notarize (${{ env.ZIP }}) | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| env: | |
| MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }} | |
| MACOS_CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }} | |
| APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | |
| run: ./scripts/ci-macos-codesign-and-notarize.sh "$PWD/$ARTIFACT_DIR/$ZIP" | |
| - name: Attest build artifacts for release | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| uses: actions/attest-build-provenance@v4 | |
| with: | |
| subject-path: ${{ env.ARTIFACT_DIR }}/* | |
| - name: Verify attestations of release artifacts | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: ./scripts/ci-verify-attestations.sh | |
| - name: Upload (${{ env.ZIP }}) | |
| uses: actions/upload-artifact@v7 | |
| env: | |
| ARTIFACT_NAME: ${{ env.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 (${{ env.TAR }}) | |
| uses: actions/upload-artifact@v7 | |
| env: | |
| ARTIFACT_NAME: ${{ env.TAR }} | |
| 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 release artifacts | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: ./scripts/ci-upload-release-artifacts.sh | |
| update-homebrew-tap: | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| needs: ci-macos | |
| runs-on: ubuntu-22.04 | |
| env: | |
| TAG: ${{ needs.ci-macos.outputs.TAG }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| sparse-checkout: | | |
| scripts/ci-update-homebrew-tap.sh | |
| - name: Update | |
| env: | |
| HOMEBREW_TAP_DEPLOY_KEY: ${{ secrets.HOMEBREW_TAP_DEPLOY_KEY }} | |
| run: ./scripts/ci-update-homebrew-tap.sh | |
| update-homebrew-core: | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| needs: ci-macos | |
| runs-on: ubuntu-latest | |
| env: | |
| TAG: ${{ needs.ci-macos.outputs.TAG }} | |
| steps: | |
| - name: Update | |
| uses: mislav/bump-homebrew-formula-action@v4 | |
| env: | |
| COMMITTER_TOKEN: ${{ secrets.HOMEBREW_CORE_PR_PAT }} | |
| with: | |
| formula-name: zsv | |
| formula-path: Formula/z/zsv.rb | |
| push-to: liquidaty/homebrew-core | |
| tag-name: v${{ env.TAG }} | |
| ci-freebsd: | |
| needs: [tag, clang-format, cppcheck, shellcheck] | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 15 | |
| env: | |
| TAG: ${{ needs.tag.outputs.TAG }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up FreeBSD | |
| uses: cross-platform-actions/action@v1.2.0 | |
| with: | |
| operating_system: freebsd | |
| version: '13.2' | |
| environment_variables: TAG ARTIFACT_DIR | |
| shell: sh | |
| - name: Set up dependencies | |
| shell: cpa.sh {0} | |
| run: | | |
| ./scripts/ci-freebsd-setup.sh | |
| - name: Test | |
| shell: cpa.sh {0} | |
| run: | | |
| export HOST= | |
| export PREFIX=${{ env.AMD64_FREEBSD_GCC }} | |
| export CC=gcc13 | |
| export MAKE=gmake | |
| RUN_TESTS=true SKIP_BUILD=true ./scripts/ci-build.sh | |
| - name: Build | |
| shell: cpa.sh {0} | |
| run: | | |
| export HOST= | |
| export PREFIX=${{ env.AMD64_FREEBSD_GCC }} | |
| export CC=gcc13 | |
| export MAKE=gmake | |
| RUN_TESTS=false SKIP_BUILD=false CFLAGS='-DPREFIX=\"\"' ./scripts/ci-build.sh | |
| - name: Prepare build artifacts for upload | |
| run: ./scripts/ci-prepare-artifacts-for-upload.sh | |
| - name: Attest build artifacts for release | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| uses: actions/attest-build-provenance@v4 | |
| with: | |
| subject-path: ${{ env.ARTIFACT_DIR }}/* | |
| - name: Verify attestations of release artifacts | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: ./scripts/ci-verify-attestations.sh | |
| - name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_FREEBSD_GCC }}.zip) | |
| uses: actions/upload-artifact@v7 | |
| env: | |
| ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_FREEBSD_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 }}.tar.gz) | |
| uses: actions/upload-artifact@v7 | |
| env: | |
| ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_FREEBSD_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 release artifacts | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: ./scripts/ci-upload-release-artifacts.sh | |
| ci-linux-mingw: | |
| needs: [tag, clang-format, cppcheck, shellcheck] | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 15 | |
| env: | |
| TAG: ${{ needs.tag.outputs.TAG }} | |
| outputs: | |
| TAG: ${{ needs.tag.outputs.TAG }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up apt dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y mingw-w64 nuget | |
| # PDCurses is bootstrapped automatically by the build (configure detects it | |
| # is not installed and app/Makefile builds the vendored copy), same as the | |
| # other vendored externals -- no manual provisioning step needed here. | |
| - name: Build | |
| env: | |
| PREFIX: ${{ env.AMD64_WINDOWS_MINGW }} | |
| CC: x86_64-w64-mingw32-gcc | |
| MAKE: make | |
| RUN_TESTS: false | |
| run: | | |
| ./scripts/ci-build.sh | |
| ./scripts/ci-create-nuget-package.sh | |
| - name: Prepare build artifacts for upload | |
| run: ./scripts/ci-prepare-artifacts-for-upload.sh | |
| - name: Attest build artifacts for release | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| uses: actions/attest-build-provenance@v4 | |
| with: | |
| subject-path: ${{ env.ARTIFACT_DIR }}/* | |
| - name: Verify attestations of release artifacts | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: ./scripts/ci-verify-attestations.sh | |
| - name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_WINDOWS_MINGW }}.zip) | |
| uses: actions/upload-artifact@v7 | |
| env: | |
| ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_WINDOWS_MINGW }}.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_WINDOWS_MINGW }}.tar.gz) | |
| uses: actions/upload-artifact@v7 | |
| env: | |
| ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_WINDOWS_MINGW }}.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_WINDOWS_MINGW }}.nupkg) | |
| uses: actions/upload-artifact@v7 | |
| env: | |
| ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_WINDOWS_MINGW }}.nupkg | |
| 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 release artifacts | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: ./scripts/ci-upload-release-artifacts.sh | |
| ci-wsl-mingw: | |
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.wsl == true }} | |
| needs: [tag, clang-format, cppcheck, shellcheck] | |
| runs-on: windows-2025 | |
| timeout-minutes: 30 | |
| env: | |
| TAG: ${{ needs.tag.outputs.TAG }} | |
| defaults: | |
| run: | |
| shell: wsl-bash {0} | |
| steps: | |
| - name: Set up WSL 2 | |
| uses: Vampire/setup-wsl@v7 | |
| with: | |
| wsl-version: 2 | |
| wsl-shell-command: bash --noprofile --norc -eo pipefail {0} | |
| set-as-default: true | |
| distribution: Ubuntu-22.04 | |
| use-cache: true | |
| additional-packages: | | |
| build-essential | |
| mingw-w64 | |
| sqlite3 | |
| tree | |
| zip | |
| tar | |
| wget | |
| tmux | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| # PDCurses is bootstrapped automatically by the build (see the build job). | |
| - name: Test | |
| env: | |
| PREFIX: amd64-wsl-mingw | |
| CC: x86_64-w64-mingw32-gcc | |
| MAKE: make | |
| CMP: diff --strip-trailing-cr | |
| RUN_TESTS: true | |
| SKIP_BUILD: true | |
| WSLENV: ARTIFACT_DIR:TAG:PREFIX:CC:MAKE:CMP:RUN_TESTS:SKIP_BUILD | |
| run: | | |
| ./scripts/ci-build.sh | |
| ci-musl: | |
| needs: [tag, clang-format, cppcheck, shellcheck] | |
| runs-on: ubuntu-latest | |
| container: alpine:3.22 | |
| timeout-minutes: 15 | |
| outputs: | |
| TAG: ${{ needs.tag.outputs.TAG }} | |
| env: | |
| TAG: ${{ needs.tag.outputs.TAG }} | |
| steps: | |
| - name: Set up dependencies | |
| shell: sh | |
| run: apk add bash gcc make musl-dev ncurses-dev ncurses-static tmux file sqlite curl zip wget tar git | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Configure git in container | |
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: Test | |
| env: | |
| PREFIX: ${{ env.AMD64_LINUX_MUSL }} | |
| CC: gcc | |
| MAKE: make | |
| RUN_TESTS: true | |
| SKIP_BUILD: true | |
| STATIC_BUILD: "1" | |
| run: ./scripts/ci-build.sh | |
| - name: Build | |
| env: | |
| PREFIX: ${{ env.AMD64_LINUX_MUSL }} | |
| CC: gcc | |
| CFLAGS: -DPREFIX=\"\" | |
| MAKE: make | |
| RUN_TESTS: false | |
| STATIC_BUILD: "1" | |
| run: ./scripts/ci-build.sh | |
| - name: Prepare build artifacts for upload | |
| run: ./scripts/ci-prepare-artifacts-for-upload.sh | |
| - name: Attest build artifacts for release | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| uses: actions/attest-build-provenance@v4 | |
| with: | |
| subject-path: ${{ env.ARTIFACT_DIR }}/* | |
| - name: Set up GitHub CLI | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: | | |
| wget https://github.com/cli/cli/releases/download/v2.63.2/gh_2.63.2_linux_amd64.tar.gz | |
| tar xvf gh_2.63.2_linux_amd64.tar.gz | |
| cp gh_2.63.2_linux_amd64/bin/gh /usr/bin | |
| rm -rf gh_2.63.2_linux_amd64 | |
| - name: Verify attestations of release artifacts | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: ./scripts/ci-verify-attestations.sh | |
| - name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_MUSL }}.zip) | |
| uses: actions/upload-artifact@v7 | |
| env: | |
| ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_MUSL }}.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_LINUX_MUSL }}.tar.gz) | |
| uses: actions/upload-artifact@v7 | |
| env: | |
| ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_MUSL }}.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 release artifacts | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: | | |
| git config --global --add safe.directory "$PWD" | |
| ./scripts/ci-upload-release-artifacts.sh | |
| ghcr: | |
| needs: [ci-musl] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| env: | |
| TAG: ${{ needs.ci-musl.outputs.TAG }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| sparse-checkout: | | |
| Dockerfile.ci | |
| - name: Download (zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_MUSL }}.zip) | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_MUSL }}.zip | |
| path: ${{ env.AMD64_LINUX_MUSL }} | |
| - name: Unzip | |
| env: | |
| ZIP: zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_MUSL }}.zip | |
| DIR: ${{ env.AMD64_LINUX_MUSL }} | |
| run: | | |
| cd "$DIR" | |
| unzip -o "$ZIP" | |
| cd .. | |
| mkdir -p ./ci | |
| mv ./"$DIR"/bin/zsv ./ci/ | |
| rm -rf ./"$DIR" | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to GitHub Container Registry | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push (on release) | |
| uses: docker/build-push-action@v7 | |
| env: | |
| DOCKER_BUILD_RECORD_UPLOAD: false | |
| with: | |
| no-cache: true | |
| context: . | |
| file: Dockerfile.ci | |
| platforms: linux/amd64 | |
| push: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| tags: | | |
| ghcr.io/liquidaty/zsv:${{ env.TAG }} | |
| ghcr.io/liquidaty/zsv:latest | |
| ci-wasm: | |
| needs: [tag, clang-format, cppcheck, shellcheck] | |
| runs-on: ubuntu-22.04-arm | |
| timeout-minutes: 15 | |
| outputs: | |
| TAG: ${{ needs.tag.outputs.TAG }} | |
| env: | |
| TAG: ${{ needs.tag.outputs.TAG }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up emsdk | |
| uses: mymindstorm/setup-emsdk@v16 | |
| - name: Set up NodeJS | |
| uses: actions/setup-node@v6 | |
| - name: Test | |
| env: | |
| PREFIX: amd64-linux-wasm | |
| CC: emcc | |
| MAKE: make | |
| CONFIGFILE: config.emcc | |
| CFLAGS: -msse2 -msimd128 | |
| CROSS_COMPILING: "yes" | |
| NO_THREADING: "1" | |
| STATIC_BUILD: "1" | |
| run: | | |
| emconfigure ./configure --enable-pic --disable-pie | |
| emmake make test CONFIGFILE=config.emcc | |
| wasm-playground: | |
| if: ${{ github.ref_name == 'main' || startsWith(github.ref, 'refs/tags/v') }} | |
| needs: [ci-wasm] | |
| runs-on: ubuntu-22.04-arm | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: simd | |
| cflags: "-msse2 -msimd128" | |
| plgdir: playground | |
| - name: non-simd | |
| cflags: "" | |
| plgdir: playground/non-simd | |
| name: wasm-playground (${{ matrix.name }}) | |
| env: | |
| TAG: ${{ needs.ci-wasm.outputs.TAG }} | |
| steps: | |
| - name: Set up emsdk | |
| uses: mymindstorm/setup-emsdk@v16 | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Update version in index.html | |
| run: sed "s|__VERSION__|$TAG|g" -i playground/index.html | |
| - name: Build | |
| env: | |
| PREFIX: amd64-linux-wasm | |
| CC: emcc | |
| MAKE: make | |
| CONFIGFILE: config.emcc | |
| CFLAGS: ${{ matrix.cflags }} | |
| CROSS_COMPILING: "yes" | |
| NO_THREADING: "1" | |
| STATIC_BUILD: "1" | |
| run: | | |
| emconfigure ./configure --enable-pic --disable-pie | |
| emmake make install NO_STDIN=1 NO_PLAYGROUND=0 | |
| mkdir -p ${{ matrix.plgdir }} | |
| cp "$PREFIX"/bin/cli.em.{js,wasm} ${{ matrix.plgdir }} | |
| - name: Upload playground artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: playground-${{ matrix.name }} | |
| path: playground | |
| upload-github-pages-artifact: | |
| if: ${{ github.ref_name == 'main' || startsWith(github.ref, 'refs/tags/v') }} | |
| needs: [prepare-linux-packages, wasm-playground] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download packages artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: packages | |
| path: ${{ env.ARTIFACT_DIR }}/packages | |
| - name: Download playground artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| pattern: playground-* | |
| path: ${{ env.ARTIFACT_DIR }} | |
| merge-multiple: true | |
| - name: Upload GitHub Pages artifacts | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: ${{ env.ARTIFACT_DIR }} | |
| deploy-to-github-pages: | |
| if: ${{ github.ref_name == 'main' || startsWith(github.ref, 'refs/tags/v') }} | |
| needs: [upload-github-pages-artifact] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 | |
| publish-winget-package: | |
| if: ${{ github.event_name == 'release' && github.event.action == 'published' }} | |
| needs: [ci-linux-mingw] | |
| runs-on: windows-latest | |
| env: | |
| TAG: ${{ needs.ci-linux-mingw.outputs.TAG }} | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Install wingetcreate | |
| run: | | |
| curl -L https://aka.ms/wingetcreate/latest -o wingetcreate | |
| chmod +x wingetcreate | |
| ./wingetcreate info | |
| - name: Sync fork | |
| env: | |
| GH_TOKEN: ${{ secrets.WINGET_PAT }} | |
| run: | | |
| gh repo sync liquidaty/winget-pkgs --branch master | |
| - name: Update (create PR) | |
| env: | |
| PAT: ${{ secrets.WINGET_PAT }} | |
| PKG_ID: "liquidaty.zsv" | |
| run: | | |
| URL="https://github.com/liquidaty/zsv/releases/download/v$TAG/zsv-$TAG-amd64-windows-mingw.zip" | |
| ./wingetcreate update "$PKG_ID" \ | |
| --version "$TAG" \ | |
| --urls "$URL" \ | |
| --out "$GITHUB_WORKSPACE/manifests" \ | |
| --token "$PAT" \ | |
| --prtitle "New version: $PKG_ID v$TAG" \ | |
| --submit | |
| - name: Upload manifest | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: zsv-${{ env.TAG }}-winget-manifest | |
| path: ${{ github.workspace }}/manifests | |
| retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} | |
| if-no-files-found: error |