Skip to content

Commit 0187bf1

Browse files
committed
Issue #12: CI: add macos, add release workflow
1 parent b9301e4 commit 0187bf1

File tree

3 files changed

+62
-41
lines changed

3 files changed

+62
-41
lines changed

.github/workflows/debian-build.yml

-35
This file was deleted.

.github/workflows/unix-build.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Unix Build
2+
3+
on:
4+
push:
5+
# branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
release:
9+
types: [ created ]
10+
11+
env:
12+
artifacts: '[ "me7sum", "ME7Check_linux", "README.md" ]'
13+
14+
jobs:
15+
build:
16+
strategy:
17+
matrix:
18+
os: [ 'ubuntu', 'macos']
19+
runs-on: ${{ matrix.os }}-latest
20+
steps:
21+
- name: install libgmp-dev
22+
if: ${{ matrix.os == 'linux' }}
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y libgmp-dev
26+
- uses: actions/checkout@v4
27+
- name: make
28+
run: make
29+
- name: make test
30+
run: make test
31+
- uses: rlespinasse/github-slug-action@v4
32+
if: ${{ github.event_name != 'release' }}
33+
with:
34+
short-length: 6
35+
- uses: actions/upload-artifact@v4
36+
if: ${{ github.event_name != 'release' }}
37+
with:
38+
name: me7sum-${{ env.GITHUB_SHA_SHORT }}-${{ matrix.os }}
39+
path: ${{ join(fromJSON(env.artifacts), '\n') }}
40+
- name: Upload ${{ matrix.os }} Artifact to Release
41+
#if: github.event_name == 'release' && github.event.action == 'created'
42+
run: |
43+
zip -qr trim-heatmap-${{ github.ref_name }}-${{ matrix.os }}.zip "${{ join(fromJSON(env.artifacts), ' ') }}"
44+
echo gh release upload ${{ github.ref_name }} me7sum-${{ github.ref_name }}-${{ matrix.os }}.zip
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/windows-build.yml

+16-6
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@ on:
55
branches: [ master ]
66
pull_request:
77
branches: [ master ]
8+
release:
9+
types: [ created ]
10+
11+
env:
12+
artifacts: >
13+
me7sum.exe
14+
ME7Check.exe
15+
README.md
816
917
jobs:
1018
build:
11-
1219
runs-on: windows-latest
13-
1420
steps:
1521
- uses: actions/checkout@v4
1622
- uses: TheMrMilchmann/setup-msvc-dev@v3
@@ -26,7 +32,11 @@ jobs:
2632
if: ${{ github.event_name != 'release' }}
2733
with:
2834
name: me7sum-${{ env.GITHUB_SHA_SHORT }}-win
29-
path: |
30-
me7sum.exe
31-
ME7Check.exe
32-
README.md
35+
path: ${{ env.artifacts }}
36+
- name: Upload Windows Artifact to Release
37+
if: github.event_name == 'release' && github.event.action == 'created'
38+
run: |
39+
zip -qr trim-heatmap-${{ github.ref_name }}-win.zip $(echo "${{ env.artifacts }}")
40+
gh release upload ${{ github.ref_name }} me7sum-${{ github.ref_name }}-win.zip
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)