-
Notifications
You must be signed in to change notification settings - Fork 0
171 lines (139 loc) · 4.45 KB
/
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
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
161
162
163
164
165
166
167
168
169
170
171
name: Release
on:
push:
branches: [main, dev]
env:
BRANCH: "main"
jobs:
release-create:
permissions: write-all
runs-on: ubuntu-latest
outputs:
release: ${{ steps.release.outputs.release_tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: release
name: Create Release
if: github.repository != 'EpitechPromo2026/B-FUN-500-TLS-5-2-glados-xavier.mitault'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then
export GITHUB_OUTPUT=$GITHUB_OUTPUT
bash ./.github/workflows/release.sh "${{ env.BRANCH }}"
else
echo "release_tag=0.0.0" >> $GITHUB_OUTPUT
fi
release-windows:
runs-on: windows-latest
needs: [release-create]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Haskell
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-version: 'latest'
- name: Install dependencies
run: ./scripts/InstallDepsWindows.ps1
- name: Build
run: make
- name: Upload To Release
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ needs.release-create.outputs.release }} "./lvtc/lvtc-exe.exe#lvtc-windows.exe"
gh release upload ${{ needs.release-create.outputs.release }} "./lvtrun/lvtrun-exe.exe#lvtrun-windows.exe"
- name: Upload To Artifact lvtc
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: lvtc-windows.exe
path: ./lvtc/lvtc-exe.exe
- name: Upload To Artifact lvtrun
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: lvtrun-windows.exe
path: ./lvtrun/lvtrun-exe.exe
release-linux:
runs-on: ubuntu-latest
needs: [release-create]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Haskell
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-version: 'latest'
- name: Install dependencies
run: sudo ./scripts/InstallDepsLinux.bash
- name: Build
run: make
- name: Rename
run: |
mv lvtc/lvtc-exe lvtc-linux
mv lvtrun/lvtrun-exe lvtrun-linux
- name: Upload To Release
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ needs.release-create.outputs.release }} "./lvtc-linux"
gh release upload ${{ needs.release-create.outputs.release }} "./lvtrun-linux"
- name: Upload To Artifact lvtc
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: lvtc-linux
path: ./lvtc-linux
- name: Upload To Artifact lvtrun
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: lvtrun-linux
path: ./lvtrun-linux
release-macos:
runs-on: macos-latest
needs: [release-create]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Haskell
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-version: 'latest'
- name: Install dependencies
run: ./scripts/InstallDepsMacos.zsh
- name: Build
run: make
- name: Rename
run: |
mv lvtc/lvtc-exe lvtc-macos
mv lvtrun/lvtrun-exe lvtrun-macos
- name: Upload To Release
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ needs.release-create.outputs.release }} "./lvtc-macos"
gh release upload ${{ needs.release-create.outputs.release }} "./lvtrun-macos"
- name: Upload To Artifact lvtc
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: lvtc-macos
path: ./lvtc-macos
- name: Upload To Artifact lvtrun
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: lvtrun-macos
path: ./lvtrun-macos