From 14ae4296874fa9bdd4b585f0ef82d43cff36b091 Mon Sep 17 00:00:00 2001 From: Gabriella Gonzalez Date: Mon, 22 Nov 2021 13:35:28 -0800 Subject: [PATCH] Improve Windows release binaries (#2322) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … by using `.zip` files instead of `.tar.bz2` and also by adding a `.exe` suffix to Windows executables This was requested in https://github.com/dhall-lang/dhall-haskell/issues/2295#issuecomment-912944840 --- .github/actions/package/action.yml | 16 +++- .github/workflows/main.yml | 116 ++++++++++++++++------------- 2 files changed, 77 insertions(+), 55 deletions(-) diff --git a/.github/actions/package/action.yml b/.github/actions/package/action.yml index 970c06ff6..619f4fe48 100644 --- a/.github/actions/package/action.yml +++ b/.github/actions/package/action.yml @@ -20,14 +20,22 @@ inputs: description: 'Override the file extension of the package file' required: false default: 'tar.bz2' - assets: + executable-extension: + description: 'Override the file extension of executables' + required: false + default: '' + executable-assets: + description: 'Files to include in the package' + required: false + default: '' + other-assets: description: 'Files to include in the package' required: false default: '' archive-command: description: 'Archive command to use' required: false - default: 'tar -jcvf' + default: 'tar --create --file' outputs: package-file: description: "Output path of the package" @@ -67,4 +75,6 @@ runs: fi echo "::set-output name=value::${value}" - shell: bash - run: ${{ inputs.archive-command }} "${{ steps.get-package-file.outputs.value }}" ${{ inputs.assets }} + run: | + EXECUTABLE_ASSETS=( ${{ inputs.executable-assets }} ) + ${{ inputs.archive-command }} "${{ steps.get-package-file.outputs.value }}" "${EXECUTABLE_ASSETS[@]/%/${{ inputs.executable-extension }}}" ${{ inputs.other-assets }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1237771b9..eca6d0760 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,67 +14,75 @@ jobs: strategy: matrix: os: - - runner: macOS-latest - package: macos - - runner: ubuntu-latest + - runner: 'macOS-latest' + package: 'macos' + archive-command: 'tar --create --file' + file-extension: 'tar.bz2' + executable-extension: '' + - runner: 'ubuntu-latest' package: null - - runner: windows-latest - package: windows + archive-command: 'tar --create --file' + file-extension: 'tar.bz2' + executable-extension: '' + - runner: 'windows-latest' + package: 'windows' + archive-command: '7z a -tzip' + file-extension: 'zip' + executable-extension: '.exe' package: - - name: dhall - assets: > - bin/dhall - share/man/man1/dhall.1 - - name: dhall-bash - assets: > - bin/dhall-to-bash - - name: dhall-csv - assets: > - bin/csv-to-dhall - bin/dhall-to-csv - - name: dhall-docs - assets: > - bin/dhall-docs - share/man/man1/dhall-docs.1 - - name: dhall-json - assets: > - bin/dhall-to-json - bin/dhall-to-yaml - bin/json-to-dhall - - name: dhall-lsp-server - assets: > - bin/dhall-lsp-server - - name: dhall-nix - assets: > - bin/dhall-to-nix - - name: dhall-openapi - assets: > - bin/openapi-to-dhall - - name: dhall-toml - assets: > - bin/dhall-to-toml - bin/toml-to-dhall - - name: dhall-yaml - assets: > - bin/dhall-to-yaml-ng - bin/yaml-to-dhall + - name: 'dhall' + executable-assets: 'bin/dhall' + other-assets: 'share/man/man1/dhall.1' + - name: 'dhall-bash' + executable-assets: 'bin/dhall-to-bash' + other-assets: '' + - name: 'dhall-csv' + executable-assets: 'bin/csv-to-dhall bin/dhall-to-csv' + other-assets: '' + - name: 'dhall-docs' + executable-assets: 'bin/dhall-docs' + other-assets: 'share/man/man1/dhall-docs.1' + - name: 'dhall-json' + executable-assets: 'bin/dhall-to-json bin/dhall-to-yaml bin/json-to-dhall' + other-assets: '' + - name: 'dhall-lsp-server' + executable-assets: 'bin/dhall-lsp-server' + other-assets: '' + - name: 'dhall-nix' + executable-assets: 'bin/dhall-to-nix' + other-assets: '' + - name: 'dhall-openapi' + executable-assets: 'bin/openapi-to-dhall' + other-assets: '' + - name: 'dhall-toml' + executable-assets: 'bin/dhall-to-toml bin/toml-to-dhall' + other-assets: '' + - name: 'dhall-yaml' + executable-assets: 'bin/dhall-to-yaml-ng bin/yaml-to-dhall' + other-assets: '' exclude: # Temporarily exclude dhall-nix on Ubuntu due to build failure # See: https://github.com/dhall-lang/dhall-haskell/runs/2920388542 - os: - runner: ubuntu-latest + runner: 'ubuntu-latest' package: null + archive-command: 'tar --create --file' + file-extension: 'tar.bz2' + executable-extension: '' package: - name: dhall-nix - assets: > - bin/dhall-to-nix + name: 'dhall-nix' + executable-assets: 'bin/dhall-to-nix' + other-assets: '' - os: - runner: windows-latest - package: windows + runner: 'windows-latest' + package: 'windows' + archive-command: '7z a -tzip' + file-extension: 'zip' + executable-extension: '.exe' package: - name: dhall-nix - assets: > - bin/dhall-to-nix + name: 'dhall-nix' + executable-assets: 'bin/dhall-to-nix' + other-assets: '' fail-fast: false name: ${{ matrix.package.name }} on ${{ matrix.os.runner }} runs-on: ${{ matrix.os.runner }} @@ -117,7 +125,11 @@ jobs: with: cabal-name: ${{ matrix.package.name }} os: ${{ matrix.os.package }} - assets: ${{ matrix.package.assets }} + executable-assets: ${{ matrix.package.executable-assets }} + other-assets: ${{ matrix.package.other-assets }} + archive-command: ${{ matrix.os.archive-command }} + file-extension: ${{ matrix.os.file-extension }} + executable-extension: ${{ matrix.os.executable-extension }} - if: ${{ matrix.os.package != null }} name: "Upload package" uses: actions/upload-artifact@v2