-
Notifications
You must be signed in to change notification settings - Fork 245
189 lines (160 loc) · 5.61 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '*'
name: Release
env:
windows_artifact: clib-win
linux_artifact: clib-linux
macos_artifact: clib-macos
jobs:
linux:
name: Release Linux
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Get Tag Name
uses: little-core-labs/get-git-tag@v3.0.1
id: tag_name
- name: System Setup
shell: bash
run: |
sudo apt update -y
sudo apt install -qq libcurl4-gnutls-dev
- name: Build Release
run: |
make
- name: Test Release
run: |
sudo make test
- name: Setup Release
run: |
mkdir -p build/bin
PREFIX=build make install
- uses: actions/upload-artifact@v3
with:
name: ${{ env.linux_artifact }}
path: build/bin
macos:
name: Release macOS
runs-on: macos-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Get Tag Name
uses: little-core-labs/get-git-tag@v3.0.1
id: tag_name
- name: System Setup
shell: bash
run: brew install curl
- name: Build Release
run: |
make
- name: Test Release
run: |
sudo make test
- name: Setup Release
run: |
mkdir -p build/bin
PREFIX=build make install
- uses: actions/upload-artifact@v3
with:
name: ${{ env.macos_artifact }}
path: build/bin
windows:
name: Release Windows
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Get Tag Name
uses: little-core-labs/get-git-tag@v3.0.1
id: tag_name
- name: System Setup
shell: bash
run: |
mkdir -p dockcross
sudo docker run --rm dockcross/windows-x64 > dockcross-windows-x64
cat dockcross-windows-x64
chmod +x dockcross-windows-x64
wget https://curl.haxx.se/download/curl-7.80.0.tar.gz
tar xzf curl-*
CURL_SRC=curl-*
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && ./configure --prefix="/work/deps/curl" --host=x86_64-w64-mingw32.static --disable-shared --with-schannel --disable-dependency-tracking --enable-threaded-resolver --disable-imap --disable-pop3 --disable-smtp --disable-ldap --disable-mqtt --disable-smb'
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && make'
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && make install'
- name: Build Release
run: |
mkdir -p build/bin
./dockcross-windows-x64 make install STATIC=true EXE=true PREFIX=build
- uses: actions/upload-artifact@v3
with:
name: ${{ env.windows_artifact }}
path: build/bin
release:
name: Release
runs-on: ubuntu-latest
needs: [linux, macos, windows]
steps:
- name: Get Tag Name
uses: little-core-labs/get-git-tag@v3.0.1
id: tag_name
- 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 }}
draft: false
prerelease: false
- name: Download Linux Artifact
uses: actions/download-artifact@v1
with:
name: ${{ env.linux_artifact }}
- name: Download macOS Artifact
uses: actions/download-artifact@v1
with:
name: ${{ env.macos_artifact }}
- name: Download Windows Artifact
uses: actions/download-artifact@v1
with:
name: ${{ env.windows_artifact }}
- name: Compress Artifacts
run: |
zip -r ${{ env.linux_artifact }}-${{ steps.tag_name.outputs.tag }}.zip ${{ env.linux_artifact }}/*
zip -r ${{ env.macos_artifact }}-${{ steps.tag_name.outputs.tag }}.zip ${{ env.macos_artifact }}/*
zip -r ${{ env.windows_artifact }}-${{ steps.tag_name.outputs.tag }}.zip ${{ env.windows_artifact }}/*
- name: Upload Linux Release Asset
id: upload-linux-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: ${{ env.linux_artifact }}-${{ steps.tag_name.outputs.tag }}.zip
asset_name: ${{ env.linux_artifact }}-${{ steps.tag_name.outputs.tag }}.zip
asset_content_type: application/zip
- name: Upload macOS Release Asset
id: upload-macos-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: ${{ env.macos_artifact }}-${{ steps.tag_name.outputs.tag }}.zip
asset_name: ${{ env.macos_artifact }}-${{ steps.tag_name.outputs.tag }}.zip
asset_content_type: application/zip
- name: Upload Windows Release Asset
id: upload-windows-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: ${{ env.windows_artifact }}-${{ steps.tag_name.outputs.tag }}.zip
asset_name: ${{ env.windows_artifact }}-${{ steps.tag_name.outputs.tag }}.zip
asset_content_type: application/zip