Skip to content

Commit 27fa2e1

Browse files
committed
CI: release now calls integration
1 parent ec7ec8e commit 27fa2e1

File tree

2 files changed

+38
-187
lines changed

2 files changed

+38
-187
lines changed

.github/workflows/integrate.yml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,20 @@ on:
88
push:
99
branches:
1010
- master
11-
tags:
12-
- '!v[0-9].*'
13-
11+
- main
12+
13+
workflow_call:
14+
1415
jobs:
1516
skip_check:
16-
name: Skip Run Check
17+
name: Run Check
1718
continue-on-error: true
1819
runs-on: ubuntu-22.04
1920
outputs:
2021
should_skip: ${{ steps.collate_checks.outputs.should_skip }}
22+
run_integration: true
23+
run_release: ${{ !steps.collate_checks.outputs.should_skip }}
2124
steps:
22-
- name: Print Release
23-
run: |
24-
echo $release
25-
env:
26-
release: ${{ fromJson(github.event.release) }}
2725
- name: Check if CI is forced
2826
id: force_ci_check
2927
if: |
@@ -40,11 +38,20 @@ jobs:
4038
draft: ${{ github.event.pull_request.draft }}
4139
run: |
4240
echo "::set-output name=should_skip::$draft"
41+
- name: Check if this is a Release
42+
id: released_check
43+
if: |
44+
github.event_name == 'push' &&
45+
github.ref_type == 'tag' &&
46+
startsWith(github.ref_name, 'v')
47+
run: |
48+
echo "::set-output name=should_skip::false"
4349
- name: Check if changes pushed
4450
id: push_new_check
4551
if: |
4652
github.event_name == 'push' &&
47-
(steps.force_ci_check.outcome == 'skipped' || steps.force_ci_check.outputs.should_skip != 'false')
53+
(steps.force_ci_check.outcome == 'skipped' || steps.force_ci_check.outputs.should_skip != 'false') &&
54+
(steps.released_check.outcome == 'skipped' || steps.released_check.outputs.should_skip != 'false')
4855
uses: fkirc/skip-duplicate-actions@v4
4956
with:
5057
skip_after_successful_duplicate: 'true'
@@ -54,15 +61,18 @@ jobs:
5461
if: |
5562
(steps.pr_draft_check.outcome == 'skipped' || steps.pr_draft_check.outputs.should_skip != 'false') &&
5663
(steps.force_ci_check.outcome == 'skipped' || steps.force_ci_check.outputs.should_skip != 'false') &&
64+
(steps.released_check.outcome == 'skipped' || steps.released_check.outputs.should_skip != 'false') &&
5765
(steps.push_new_check.outcome == 'skipped' || steps.push_new_check.outputs.should_skip == 'true')
5866
env:
5967
pr_draft_check: ${{ steps.pr_draft_check.outcome }}
6068
force_ci_check: ${{ steps.force_ci_check.outcome }}
69+
released_check: ${{ steps.released_check.outcome }}
6170
push_new_check: ${{ steps.push_new_check.outcome }}
6271
run: |
63-
echo "Step status was $pr_draft_check : $force_ci_check : $push_new_check"
72+
echo "Step status was $pr_draft_check : $force_ci_check : $released_check : $push_new_check"
6473
if [ "$pr_draft_check" == "skipped" ] && \
6574
[ "$force_ci_check" == "skipped" ] && \
75+
[ "$released_check" == "skipped" ] && \
6676
[ "$push_new_check" == "skipped" ]
6777
then
6878
echo "All checks skipped, I don't know what to do."
@@ -72,7 +82,7 @@ jobs:
7282
fi
7383
7484
build-win:
75-
runs-on: windows-2022
85+
runs-on: windows-latest
7686
name: Build for Windows
7787
needs: skip_check
7888
if: needs.skip_check.outputs.should_skip != 'true'
@@ -147,11 +157,9 @@ jobs:
147157
- name: Install dependencies
148158
run: |
149159
sudo apt-get update && sudo apt-get install xsltproc -y
150-
151160
- name: Build Generic64
152161
run: |
153162
CFLAGS="-O3 -g0 -march=x86-64 -mtune=native" ASMFLAGS="-march=x86-64 -mtune=native" make generic64/libXKCP.so
154-
155163
- name: Build SSSE3
156164
run: |
157165
CFLAGS="-O3 -g0 -march=core2 -msse2 -mssse3 -mtune=native" ASMFLAGS="-march=core2 -mtune=native" make SSSE3/libXKCP.so
@@ -179,7 +187,7 @@ jobs:
179187
bin/artifacts/include
180188
181189
build-osx:
182-
name: Build for Mac OSX
190+
name: Build for MacOS
183191
runs-on: macos-latest
184192
needs: skip_check
185193
if: needs.skip_check.outputs.should_skip != 'true'

.github/workflows/release.yml

Lines changed: 15 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -1,191 +1,34 @@
1-
name: Create Release
1+
name: Release
2+
concurrency: ci-${{ github.ref }}
23
on:
34
push:
45
tags:
5-
- v*
6-
jobs:
7-
skip_check:
8-
name: Skip Run Check
9-
continue-on-error: true
10-
runs-on: ubuntu-22.04
11-
outputs:
12-
should_skip: ${{ steps.collate_checks.outputs.should_skip }}
13-
steps:
14-
- name: Print Release
15-
id: force_ci_check
16-
run: |
17-
echo $release
18-
env:
19-
release: ${{ fromJson(github.event.release) }}
20-
- name: Collate Checks
21-
id: collate_checks
22-
run: |
23-
echo "::set-output name=should_skip::false"
24-
25-
build-win:
26-
runs-on: windows-2022
27-
name: Build for Windows
28-
needs: skip_check
29-
if: needs.skip_check.outputs.should_skip != 'true'
30-
steps:
31-
- uses: actions/checkout@v3
32-
- name: Add msbuild to PATH
33-
uses: microsoft/setup-msbuild@v1.1
34-
- name: Add Path Msys64 Directory
35-
run: |
36-
echo "c:\msys64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
37-
- name: Install msys2 dependencies
38-
shell: msys2_shell.cmd -defterm -no-start -here -ucrt64 {0}
39-
run: |
40-
pacman -S --noconfirm ucrt64/mingw-w64-ucrt-x86_64-libxslt ucrt64/mingw-w64-ucrt-x86_64-make ucrt64/mingw-w64-ucrt-x86_64-gcc
41-
ln -s /ucrt64/bin/mingw32-make.exe /ucrt64/bin/make.exe
42-
echo GCC: $(which gcc)
43-
echo MAKE: $(which make)
44-
echo MSYSTEM: ${MSYSTEM}
45-
- name: Build Generic64
46-
shell: msys2_shell.cmd -defterm -no-start -here -ucrt64 {0}
47-
run: |
48-
make generic64/libXKCP.so
49-
env:
50-
CFLAGS: -O3 -g0 -march=x86-64 -mtune=native
51-
ASMFLAGS: -march=x86-64 -mtune=native
52-
- name: Build SSSE3
53-
shell: msys2_shell.cmd -defterm -no-start -here -ucrt64 {0}
54-
run: |
55-
make SSSE3/libXKCP.so
56-
env:
57-
CFLAGS: -O3 -g0 -march=core2 -msse2 -mssse3 -mtune=native
58-
ASMFLAGS: -march=core2 -mtune=native
59-
- name: Build AVX2
60-
shell: msys2_shell.cmd -defterm -no-start -here -ucrt64 {0}
61-
run: |
62-
make AVX2/libXKCP.so
63-
env:
64-
CFLAGS: -O3 -g0 -march=skylake -mtune=native
65-
ASMFLAGS: -march=skylake -mtune=native
66-
- name: Build AVX512
67-
shell: msys2_shell.cmd -defterm -no-start -here -ucrt64 {0}
68-
run: |
69-
make AVX512/libXKCP.so
70-
env:
71-
CFLAGS: -O3 -g0 -march=skylake-avx512 -mtune=native
72-
ASMFLAGS: -march=skylake-avx512 -mtune=native
73-
74-
- name: Rename artifacts
75-
run: |
76-
mkdir bin/artifacts
77-
mv bin/AVX2/libXKCP.so bin/artifacts/XKCP-AVX2.dll
78-
mv bin/AVX512/libXKCP.so bin/artifacts/XKCP-AVX512.dll
79-
mv bin/SSSE3/libXKCP.so bin/artifacts/XKCP-SSSE3.dll
80-
mv bin/generic64/libXKCP.so bin/artifacts/XKCP.dll
81-
mv bin/generic64/libXKCP.so.headers bin/artifacts/include
82-
ls bin/artifacts
83-
- name: Upload artifact
84-
uses: actions/upload-artifact@v2
85-
with:
86-
name: XKCP-win
87-
path: |
88-
bin/artifacts/*.dll
89-
bin/artifacts/libXKCP-win.so.headers
90-
91-
build-linux:
92-
name: Build for Linux
93-
runs-on: ubuntu-latest
94-
needs: skip_check
95-
if: needs.skip_check.outputs.should_skip != 'true'
96-
steps:
97-
- uses: actions/checkout@v3
98-
- name: Install dependencies
99-
run: |
100-
sudo apt-get update && sudo apt-get install xsltproc -y
101-
102-
- name: Build Generic64
103-
run: |
104-
CFLAGS="-O3 -g0 -march=x86-64 -mtune=native" ASMFLAGS="-march=x86-64 -mtune=native" make generic64/libXKCP.so
105-
- name: Build SSSE3
106-
run: |
107-
CFLAGS="-O3 -g0 -march=core2 -msse2 -mssse3 -mtune=native" ASMFLAGS="-march=core2 -mtune=native" make SSSE3/libXKCP.so
108-
- name: Build AVX2
109-
run: |
110-
CFLAGS="-O3 -g0 -march=skylake -mtune=native" ASMFLAGS="-march=skylake -mtune=native" make AVX2/libXKCP.so
111-
- name: Build AVX512
112-
run: |
113-
CFLAGS="-O3 -g0 -march=skylake-avx512 -mtune=native" ASMFLAGS="-march=skylake-avx512 -mtune=native" make AVX512/libXKCP.so
114-
- name: Rename artifacts
115-
run: |
116-
mkdir bin/artifacts
117-
mv bin/AVX2/libXKCP.so bin/artifacts/libXKCP-AVX2.so
118-
mv bin/AVX512/libXKCP.so bin/artifacts/libXKCP-AVX512.so
119-
mv bin/SSSE3/libXKCP.so bin/artifacts/libXKCP-SSSE3.so
120-
mv bin/generic64/libXKCP.so bin/artifacts/libXKCP.so
121-
mv bin/generic64/libXKCP.so.headers bin/artifacts/include
122-
ls bin/artifacts
123-
- name: Upload artifact
124-
uses: actions/upload-artifact@v2
125-
with:
126-
name: XKCP-linux
127-
path: |
128-
bin/artifacts/*.so
129-
bin/artifacts/include
130-
131-
build-osx:
132-
name: Build for Mac OSX
133-
runs-on: macos-latest
134-
needs: skip_check
135-
if: needs.skip_check.outputs.should_skip != 'true'
136-
steps:
137-
- uses: actions/checkout@v3
138-
- name: Install dependencies
139-
run: |
140-
brew install libxslt
141-
- name: Build for ARMv8A (M-series)
142-
run: |
143-
CFLAGS="-target aarch64-apple-darwin -arch arm64 -O3 -g0 -march=armv8-a" ASMFLAGS="-march=armv8-a" make ARMv8A/libXKCP.dylib
144-
- name: Build Generic x86_64
145-
run: |
146-
CFLAGS="-target x86_64-apple-darwin -arch x86_64 -O3 -g0 -march=x86-64 -mtune=native" ASMFLAGS="-march=x86-64 -mtune=native" make generic64/libXKCP.dylib
147-
- name: Build SSSE3
148-
run: |
149-
CFLAGS="-target x86_64-apple-darwin -arch x86_64 -O3 -g0 -march=core2 -msse2 -mssse3 -mtune=native" ASMFLAGS="-march=core2 -mtune=native" make SSSE3/libXKCP.dylib
150-
- name: Build AVX2
151-
run: |
152-
CFLAGS="-target x86_64-apple-darwin -arch x86_64 -O3 -g0 -march=skylake -mtune=native" ASMFLAGS="-march=skylake -mtune=native" make AVX2/libXKCP.dylib
153-
- name: Build AVX512
154-
run: |
155-
CFLAGS="-target x86_64-apple-darwin -arch x86_64 -O3 -g0 -march=skylake-avx512 -mtune=native" ASMFLAGS="-march=skylake-avx512 -mtune=native" make AVX512/libXKCP.dylib
156-
- name: Rename and merge Generic64 and ARMv8A artifacts
157-
run: |
158-
mkdir bin/artifacts
159-
mv bin/AVX2/libXKCP.dylib bin/artifacts/libXKCP-AVX2.dylib
160-
mv bin/AVX512/libXKCP.dylib bin/artifacts/libXKCP-AVX512.dylib
161-
mv bin/SSSE3/libXKCP.dylib bin/artifacts/libXKCP-SSSE3.dylib
162-
lipo bin/generic64/libXKCP.dylib bin/ARMv8A/libXKCP.dylib -create -output bin/artifacts/libXKCP.dylib
163-
mv bin/generic64/libXKCP.dylib.headers bin/artifacts/include
164-
ls bin/artifacts
165-
- name: Upload artifact
166-
uses: actions/upload-artifact@v2
167-
with:
168-
name: XKCP-osx
169-
path: |
170-
bin/artifacts/*.dylib
171-
bin/artifacts/libXKCP-osx.dylib.headers
6+
- 'v[0-9]+.*'
1727

8+
jobs:
9+
integration:
10+
name: Integration
11+
uses: ./.github/workflows/integrate.yml
12+
17313
create-release:
17414
name: Create Release
15+
needs: integration
17516
runs-on: ubuntu-latest
176-
needs: [build-linux,build-osx,build-win]
17717
steps:
17818
- name: Download all XKCP artifacts
179-
uses: actions/download-artifact@v2
19+
uses: actions/download-artifact@v3
20+
- name: Show files
21+
run: |
22+
ls -lR
18023
- name: Repackage as release artifacts
18124
run: |
18225
mkdir artifacts/
18326
tar czf artifacts/XKCP-linux.tar.gz -C XKCP-linux/ $(find XKCP-linux -type f -name "*.so" -exec basename {} \;)
18427
tar czf artifacts/XKCP-osx.tar.gz -C XKCP-osx/ $(find XKCP-osx -type f -name "*.dylib" -exec basename {} \;)
18528
tar czf artifacts/XKCP-win.tar.gz -C XKCP-win/ $(find XKCP-win -type f -name "*.dll" -exec basename {} \;)
186-
tar czf artifacts/XKCP-headers.tar.gz -C XKCP-linux/ XKCP-linux/include/
29+
tar czf artifacts/XKCP-headers.tar.gz -C XKCP-linux/ include/
18730
- name: Create release on GitHub
188-
uses: softprops/action-gh-release@v0.1.12
31+
uses: softprops/action-gh-release@v0.1.14
18932
with:
19033
name: XKCP
19134
files: |

0 commit comments

Comments
 (0)