-
-
Notifications
You must be signed in to change notification settings - Fork 13
160 lines (130 loc) · 4.05 KB
/
main.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Haskell Stack CI
on: [push]
jobs:
linux:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Lua
uses: leafo/gh-actions-lua@v10
- name: Cache .stack-work
uses: actions/cache@v4
with:
path: .stack-work
key: tasklite_stack-work_ubuntu
restore-keys: tasklite_stack-work_ubuntu
- name: Setup Stack
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-no-global: true
- name: Cache Stack build files
uses: actions/cache@v4
with:
path: |
~/.stack
airsequel-cli/.stack-work
key: >-
${{ runner.os }}-stack-${{
hashFiles('stack.yaml.lock', 'airsequel-cli/package.yaml') }}
restore-keys: |
${{runner.os}}-stack
- name: Install TaskLite CLI tool
run: stack install tasklite
- name: Run test suite
run: stack test
- name: Test adding of tasks
run: /home/runner/.local/bin/tasklite add Buy milk
- name: Test listing of tasks
run: /home/runner/.local/bin/tasklite
- name: Upload Linux Release
uses: actions/upload-artifact@v4
with:
path: /home/runner/.local/bin/tasklite
name: tasklite_linux_x86_64.zip
macos:
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Lua
uses: leafo/gh-actions-lua@v10
- name: Cache .stack-work
uses: actions/cache@v4
with:
path: .stack-work
key: tasklite_stack-work_macos
restore-keys: tasklite_stack-work_macos
- name: Setup Stack
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-no-global: true
- name: Install TaskLite CLI tool
run: stack install tasklite
- name: Run test suite
run: stack test
- name: Test adding of tasks
run: /Users/runner/.local/bin/tasklite add Buy milk
- name: Test listing of tasks
run: /Users/runner/.local/bin/tasklite
- name: Upload MacOS Release
uses: actions/upload-artifact@v4
with:
path: /Users/runner/.local/bin/tasklite
name: tasklite_macos_x86_64.zip
docker:
runs-on: ubuntu-20.04
steps:
- name: Checkout Git Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: adius/tasklite:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
# windows:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v4
# - name: Install stack
# shell: cmd
# run: choco install haskell-stack
# - name: Install dependencies
# run: stack install tasklite
# - name: Upload Windows Release
# uses: actions/upload-artifact@v4
# with:
# path: '%APPDATA%\local\bin\tasklite.exe'
# name: tasklite_windows_x86_64.exe
# publish:
# needs: build
# runs-on: ubuntu-18.04
# steps:
# - name: Set env with output of `git describe`
# run: echo ::set-env name=GIT_DESCRIBE::$(git describe)
#
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ env.GIT_DESCRIBE }}
# release_name: Release ${{ env.GIT_DESCRIBE }}
# body: ${{ github.event.commits[0].message }}
# draft: false
# prerelease: false