Skip to content

Commit

Permalink
Improve Windows release binaries (dhall-lang#2322)
Browse files Browse the repository at this point in the history
… by using `.zip` files instead of `.tar.bz2` and also by
adding a `.exe` suffix to Windows executables

This was requested in dhall-lang#2295 (comment)
  • Loading branch information
Gabriella439 authored Nov 22, 2021
1 parent 186219f commit 14ae429
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 55 deletions.
16 changes: 13 additions & 3 deletions .github/actions/package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 }}
116 changes: 64 additions & 52 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 14ae429

Please sign in to comment.