forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (99 loc) · 3.73 KB
/
artifacts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Artifacts
on:
push:
branches:
- master
pull_request:
release:
types:
- created
jobs:
artifact-linux:
name: Artifact on Linux
runs-on: ubuntu-18.04
container:
# Older Ubuntu for older glibc
image: phadej/ghc:8.6.5-xenial
steps:
- name: Set PATH
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- name: Install newer Python3
run: |
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get install -y python3.8
- uses: actions/checkout@v2
- name: Package project
run: |
cabal v2-sdist --builddir=sdist Cabal cabal-install-solver cabal-install
python3.8 release.py --tarlib=sdist/sdist/Cabal-*.tar.gz --tarsolver=sdist/sdist/cabal-install-solver-3.*.tar.gz --tarexe=sdist/sdist/cabal-install-3.*.tar.gz
- uses: actions/upload-artifact@v2
with:
name: cabal-linux
path: _build/artifacts/*
artifact-macos:
name: Artifact on macOS
runs-on: macos-latest
steps:
- name: Install GHC
run: |
cd $(mktemp -d)
curl -sLO "https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-apple-darwin.tar.xz"
tar -xJf ghc-*.tar.xz
cd ghc-*
./configure --prefix=/opt/ghc/8.6.5
sudo make install
- name: Install Cabal
run: |
cd $(mktemp -d)
curl -sLO http://oleg.fi/cabal-install-3.4.0.0-rc1/cabal-install-3.4.0.0-x86_64-darwin-sierra.tar.xz
tar -xJf cabal-install-*.tar.xz
sudo mkdir -p /opt/cabal/3.4/bin
sudo cp cabal /opt/cabal/3.4/bin/cabal
sudo chmod 755 /opt/cabal/3.4/bin/cabal
- name: Set PATH
run: |
echo "/opt/ghc/8.6.5/bin" >> $GITHUB_PATH
echo "/opt/cabal/3.4/bin" >> $GITHUB_PATH
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- uses: actions/checkout@v2
- name: Package project
run: |
cabal v2-sdist --builddir=sdist Cabal cabal-install-solver cabal-install
python3 release.py --tarlib=sdist/sdist/Cabal-*.tar.gz --tarsolver=sdist/sdist/cabal-install-solver-3.*.tar.gz --tarexe=sdist/sdist/cabal-install-3.*.tar.gz
- uses: actions/upload-artifact@v2
with:
name: cabal-macos
path: _build/artifacts/*
artifact-windows:
name: Artifact on Windows
runs-on: windows-latest
steps:
- name: Install Cabal
run: choco install -fy cabal --version 3.0.0.0
- name: Install GHC
run: |
choco uninstall -y ghc
choco install -y ghc --version 8.6.5
- name: Set PATH
run: |
[Environment]::GetEnvironmentVariable("Path")
Write-Output "C:\ProgramData\chocolatey\lib\cabal\tools\cabal-3.0.0.0" | Out-File $Env:GITHUB_PATH
Write-Output "C:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.6.5\bin" | Out-File $Env:GITHUB_PATH
- name: Print versions
run: |
ghc --version
cabal --version
cabal user-config init -a "http-transport: plain-http" -a "store-dir: C:\SR" -f -v3
- uses: actions/checkout@v2
- name: Package project
# We hardcode version 3 here to make first glob not overlap with cabal-install
run: |
cabal v2-sdist --builddir=sdist Cabal cabal-install-solver cabal-install
New-Item -Path "_build" -ItemType "directory"
python release.py --tarlib=$(Resolve-Path -Path sdist/sdist/Cabal-3.*.tar.gz) --tarsolver=$(Resolve-Path -Path sdist/sdist/cabal-install-solver-3.*.tar.gz) --tarexe=$(Resolve-Path -Path sdist/sdist/cabal-install-3.*.tar.gz)
- uses: actions/upload-artifact@v2
with:
name: cabal-windows
path: _build/artifacts/*