Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
3c5505d222
|
15
.cirrus.yml
15
.cirrus.yml
@@ -1,15 +0,0 @@
|
|||||||
freebsd_instance:
|
|
||||||
image_family: freebsd-13-1
|
|
||||||
|
|
||||||
task:
|
|
||||||
env:
|
|
||||||
GHC_VER: 9.2.4
|
|
||||||
CABAL_VER: 3.6.2.0
|
|
||||||
ARTIFACT: "x86_64-portbld-freebsd-ghcup"
|
|
||||||
ARCH: 64
|
|
||||||
RUNNER_OS: FreeBSD
|
|
||||||
install_script: pkg install -y ghc hs-cabal-install git bash
|
|
||||||
script:
|
|
||||||
- bash .github/scripts/release.sh
|
|
||||||
binaries_artifacts:
|
|
||||||
path: "out/x86_64-portbld-freebsd-ghcup-*"
|
|
||||||
101
.github/scripts/release.sh
vendored
101
.github/scripts/release.sh
vendored
@@ -1,101 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
mkdir -p "$HOME"/.local/bin
|
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" = "macOS" ] ; then
|
|
||||||
if ! command -v brew ; then
|
|
||||||
git clone --depth=1 https://github.com/Homebrew/brew "$HOME/.brew"
|
|
||||||
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
|
|
||||||
brew update
|
|
||||||
fi
|
|
||||||
brew install git
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" = "Linux" ] ; then
|
|
||||||
apk add --no-cache \
|
|
||||||
curl \
|
|
||||||
gcc \
|
|
||||||
g++ \
|
|
||||||
binutils \
|
|
||||||
binutils-gold \
|
|
||||||
bsd-compat-headers \
|
|
||||||
gmp-dev \
|
|
||||||
ncurses-dev \
|
|
||||||
libffi-dev \
|
|
||||||
make \
|
|
||||||
xz \
|
|
||||||
tar \
|
|
||||||
perl \
|
|
||||||
bash \
|
|
||||||
git
|
|
||||||
|
|
||||||
apk add --no-cache \
|
|
||||||
zlib \
|
|
||||||
zlib-dev \
|
|
||||||
zlib-static \
|
|
||||||
bzip2 \
|
|
||||||
bzip2-dev \
|
|
||||||
bzip2-static \
|
|
||||||
gmp \
|
|
||||||
gmp-dev \
|
|
||||||
openssl-dev \
|
|
||||||
openssl-libs-static \
|
|
||||||
xz \
|
|
||||||
xz-dev \
|
|
||||||
ncurses-static
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! command -v ghcup ; then
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh
|
|
||||||
source ~/.ghcup/env
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" != "FreeBSD" ] ; then
|
|
||||||
ghcup install ghc --set --isolate="$HOME/.local" --force "$GHC_VER"
|
|
||||||
ghcup install cabal --isolate="$HOME/.local/bin" --force "$CABAL_VER"
|
|
||||||
ghc --version
|
|
||||||
cabal --version
|
|
||||||
fi
|
|
||||||
|
|
||||||
ecabal() {
|
|
||||||
cabal "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
git describe --all
|
|
||||||
|
|
||||||
# build
|
|
||||||
ecabal update
|
|
||||||
|
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" = "Linux" ] ; then
|
|
||||||
if [ "${ARCH}" = "32" ] ; then
|
|
||||||
ecabal build -w "ghc-${GHC_VER}" --ghc-options='-split-sections -optl-static' -ftui
|
|
||||||
elif [ "${ARCH}" = "64" ] ; then
|
|
||||||
ecabal build -w "ghc-${GHC_VER}" --ghc-options='-split-sections -optl-static' -ftui
|
|
||||||
else
|
|
||||||
ecabal build -w "ghc-${GHC_VER}" -ftui
|
|
||||||
fi
|
|
||||||
elif [ "${RUNNER_OS}" = "FreeBSD" ] ; then
|
|
||||||
ecabal build -w "ghc-${GHC_VER}" --ghc-options='-split-sections' --constraint="zlib +bundled-c-zlib" --constraint="zip +disable-zstd" -ftui
|
|
||||||
elif [ "${RUNNER_OS}" = "Windows" ] ; then
|
|
||||||
ecabal build -w "ghc-${GHC_VER}" --constraint="zlib +bundled-c-zlib" --constraint="lzma +static"
|
|
||||||
else
|
|
||||||
ecabal build -w "ghc-${GHC_VER}" --constraint="zlib +bundled-c-zlib" --constraint="lzma +static" -ftui
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir out
|
|
||||||
binary=$(ecabal new-exec -w "ghc-${GHC_VER}" --verbose=0 --offline sh -- -c 'command -v ghcup')
|
|
||||||
ver=$("${binary}" --numeric-version)
|
|
||||||
if [ "${RUNNER_OS}" = "macOS" ] ; then
|
|
||||||
strip "${binary}"
|
|
||||||
else
|
|
||||||
if [ "${RUNNER_OS}" != "Windows" ] ; then
|
|
||||||
strip -s "${binary}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
cp "${binary}" "out/${ARTIFACT}-${ver}"
|
|
||||||
|
|
||||||
148
.github/workflows/release.yaml
vendored
148
.github/workflows/release.yaml
vendored
@@ -6,80 +6,104 @@ on:
|
|||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release-linux:
|
draft_release:
|
||||||
name: Create Release x86_64
|
name: Draft Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref }}
|
||||||
|
release_name: Release ${{ github.ref }}
|
||||||
|
body: |
|
||||||
|
Changes in this Release
|
||||||
|
- First Change
|
||||||
|
- Second Change
|
||||||
|
draft: true
|
||||||
|
prerelease: false
|
||||||
|
|
||||||
|
release-mac:
|
||||||
|
name: Create Release
|
||||||
|
needs: draft_release
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
CABAL_VER: 3.6.2.0
|
|
||||||
CACHE_VER: 1
|
|
||||||
MACOSX_DEPLOYMENT_TARGET: 10.13
|
MACOSX_DEPLOYMENT_TARGET: 10.13
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
os:
|
||||||
- os: ubuntu-latest
|
- macOS-10.15
|
||||||
ARTIFACT: "i386-linux-ghcup"
|
|
||||||
GHC_VER: 8.10.7
|
|
||||||
ARCH: 32
|
|
||||||
- os: ubuntu-latest
|
|
||||||
ARTIFACT: "x86_64-linux-ghcup"
|
|
||||||
GHC_VER: 8.10.7
|
|
||||||
ARCH: 64
|
|
||||||
- os: [self-hosted, macOS, aarch64]
|
|
||||||
ARTIFACT: "aarch64-apple-darwin-ghcup"
|
|
||||||
GHC_VER: 9.2.5
|
|
||||||
ARCH: 64
|
|
||||||
- os: macOS-10.15
|
|
||||||
ARTIFACT: "x86_64-apple-darwin-ghcup"
|
|
||||||
GHC_VER: 9.2.5
|
|
||||||
ARCH: 64
|
|
||||||
- os: windows-latest
|
|
||||||
ARTIFACT: "x86_64-mingw64-ghcup"
|
|
||||||
GHC_VER: 8.10.7
|
|
||||||
ARCH: 64
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- if: matrix.ARCH == '32' && runner.os == 'Linux'
|
- uses: haskell/actions/setup@v1.2
|
||||||
name: Run release (32 bit linux)
|
|
||||||
uses: docker://i386/alpine:3.12
|
|
||||||
with:
|
with:
|
||||||
args: sh .github/scripts/release.sh
|
ghc-version: 8.10.7
|
||||||
env:
|
cabal-version: 3.6.2.0
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
|
||||||
ARCH: ${{ matrix.ARCH }}
|
|
||||||
GHC_VER: ${{ matrix.GHC_VER }}
|
|
||||||
|
|
||||||
- if: matrix.ARCH == '64' && runner.os == 'Linux'
|
- name: create ~/.local/bin
|
||||||
name: Run release (64 bit linux)
|
run: mkdir -p "$HOME/.local/bin"
|
||||||
uses: docker://alpine:3.12
|
shell: bash
|
||||||
|
|
||||||
|
- name: Add ~/.local/bin to PATH
|
||||||
|
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Update cabal cache
|
||||||
|
run: cabal update
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Install cabal dependencies
|
||||||
|
run: cabal build --only-dependencies --constraint="zlib +bundled-c-zlib" --constraint="lzma +static" -ftui
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: cabal build --constraint="zlib +bundled-c-zlib" --constraint="lzma +static" -ftui
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
run: cp "$(cabal list-bin exe:ghcup)" ~/.local/bin/ghcup
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Strip
|
||||||
|
run: strip ~/.local/bin/ghcup
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: cabal test --constraint="zlib +bundled-c-zlib" --constraint="lzma +static" all
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Install git
|
||||||
|
run: brew install git
|
||||||
|
|
||||||
|
- name: set HOME
|
||||||
|
run: echo "HOME=$HOME" >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Set ASSET_PATH
|
||||||
|
run: echo "ASSET_PATH=$HOME/.local/bin/ghcup" >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Upload Release Asset
|
||||||
|
id: upload-release-asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
args: sh .github/scripts/release.sh
|
upload_url: ${{ needs.draft_release.outputs.upload_url }}
|
||||||
env:
|
asset_path: ${{ env.ASSET_PATH }}
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
asset_name: ghcup-${{ matrix.os }}
|
||||||
ARCH: ${{ matrix.ARCH }}
|
asset_content_type: application/octet-stream
|
||||||
GHC_VER: ${{ matrix.GHC_VER }}
|
|
||||||
|
|
||||||
- if: runner.os != 'Linux'
|
|
||||||
name: Run release (windows/mac)
|
|
||||||
run: bash .github/scripts/release.sh
|
|
||||||
env:
|
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
|
||||||
ARCH: ${{ matrix.ARCH }}
|
|
||||||
GHC_VER: ${{ matrix.GHC_VER }}
|
|
||||||
|
|
||||||
- if: always()
|
- if: always()
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: artifacts
|
name: plan.json
|
||||||
path: |
|
path: ./dist-newstyle/cache/plan.json
|
||||||
./out/*
|
|
||||||
./dist-newstyle/cache/plan.json
|
|
||||||
|
|
||||||
- name: Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
files: |
|
|
||||||
./out/*
|
|
||||||
./dist-newstyle/cache/plan.json
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ optional-packages: ./vendored/*/*.cabal
|
|||||||
optimization: 2
|
optimization: 2
|
||||||
|
|
||||||
package ghcup
|
package ghcup
|
||||||
|
tests: True
|
||||||
flags: +tui
|
flags: +tui
|
||||||
|
|
||||||
source-repository-package
|
source-repository-package
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ library
|
|||||||
build-depends:
|
build-depends:
|
||||||
, bzlib
|
, bzlib
|
||||||
, process ^>=1.6.11.0
|
, process ^>=1.6.11.0
|
||||||
, Win32 >=2.10
|
, Win32 ^>=2.10
|
||||||
|
|
||||||
else
|
else
|
||||||
other-modules:
|
other-modules:
|
||||||
|
|||||||
@@ -577,8 +577,8 @@ $Msys2Shell = ('{0}\msys2_shell.cmd' -f $MsysDir)
|
|||||||
# The bootstrap script is always silent, since we ask relevant questions here
|
# The bootstrap script is always silent, since we ask relevant questions here
|
||||||
$SilentExport = 'export BOOTSTRAP_HASKELL_NONINTERACTIVE=1 ;'
|
$SilentExport = 'export BOOTSTRAP_HASKELL_NONINTERACTIVE=1 ;'
|
||||||
|
|
||||||
if ($InstallStack) {
|
if (!($InstallStack)) {
|
||||||
$StackInstallExport = 'export BOOTSTRAP_HASKELL_INSTALL_STACK=1 ;'
|
$StackInstallExport = 'export BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 ;'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($InstallHLS) {
|
if ($InstallHLS) {
|
||||||
|
|||||||
Reference in New Issue
Block a user