-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (73 loc) · 2.84 KB
/
create-release.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
# This is a basic workflow to help you get started with Actions
name: Create release
# Controls when the action will run.
on:
# Triggers the workflow on push events but only for the master branch and tag pushes
push:
tags: 'v*'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
matrix:
# only ubuntu for now, because we only support compiling to ELF files
os: [ubuntu-latest]
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
name: Build and release nsc
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Install Stack
run: stack --version
- name: Install GHC
run: stack setup --install-ghc
- name: Install required tools
run: |
echo "::group::C2HS"
stack install c2hs
echo "PATH=~/.local/bin:$PATH" >> $GITHUB_ENV
echo "::end-group::"
echo "::group::glibc v2.31"
sudo apt-get install libc-dev
echo "::end-group::"
- name: Build Haskell dependencies
run: stack build --test --no-run-tests --only-dependencies --no-terminal
- name: Build NSC
id: build-nsc
run: stack build --test --no-run-tests --ghc-options=-fforce-recomp --ghc-options=-split-sections --ghc-options=-fdiagnostics-color=always
# --ghc-options=-fdefer-diagnostics
- name: Run tests
run: stack test
- name: Install NSC
run: stack install
- name: Get pushed tag
id: release-tag
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Create release
id: create-release
uses: avakar/tag-and-release@v1
with:
tag_name: ${{ steps.release-tag.outputs.tag }}
release_name: <<Edit title>>
body: <<Edit body>>
prerelease: false
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get local bin path
id: local-bin-path
run: |
echo ::set-output name=path::$(stack path | awk -F': ' '$1 == "local-bin" { print $2 }')
- name: Upload executable file
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ steps.local-bin-path.outputs.path }}/nsc
asset_name: nsc-ubuntu
asset_content_type: application/octet-stream