Skip to content

Commit d01188f

Browse files
committed
ci: create full build & relase pipeline on all supported platforms
Make relase on new tag, continuous pre-relase otherwise
1 parent 64c6430 commit d01188f

File tree

4 files changed

+96
-11
lines changed

4 files changed

+96
-11
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Build & Release for all platforms
2+
on:
3+
push:
4+
workflow_dispatch:
5+
6+
jobs:
7+
8+
build-linux-x64:
9+
uses: ./.github/workflows/linux-build-bundle.yml
10+
11+
build-windows-x64:
12+
uses: ./.github/workflows/windows-build-bundle.yml
13+
with:
14+
msystem: UCRT64
15+
16+
build-macos-x64:
17+
uses: ./.github/workflows/macos-build-bundle.yml
18+
with:
19+
runner: macos-15-intel
20+
21+
build-macos-arm64:
22+
uses: ./.github/workflows/macos-build-bundle.yml
23+
with:
24+
runner: macos-15
25+
26+
make-release:
27+
28+
runs-on: ubuntu-latest
29+
30+
needs:
31+
- build-linux-x64
32+
- build-windows-x64
33+
- build-macos-x64
34+
- build-macos-arm64
35+
36+
steps:
37+
38+
- name: Checkout repo
39+
uses: actions/checkout@v5
40+
with:
41+
fetch-depth: 0
42+
43+
- name: Save git info
44+
id: git_info
45+
run: |
46+
latest_tag=$(git describe --tags --abbrev=0)
47+
echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT
48+
49+
rev_count=$(git rev-list --count "${latest_tag}"..HEAD)
50+
echo "rev_count=$rev_count" >> $GITHUB_OUTPUT
51+
52+
- name: Download release artifacts
53+
uses: actions/download-artifact@v5
54+
55+
- name: Make new release
56+
env:
57+
GH_TOKEN: ${{ github.token }}
58+
run:
59+
files_list=$(find *-artifact-* -type f | paste -sd' ')
60+
gh release create ${{ steps.git_info.outputs.latest_tag }} $files_list --latest \
61+
--title 'ZeGrapher ${{ steps.git_info.outputs.latest_tag }}' \
62+
--notes-from-tag
63+
if: steps.git_info.outputs.rev_count == 0
64+
65+
- name: Make new continuous build
66+
env:
67+
GH_TOKEN: ${{ github.token }}
68+
run:
69+
files_list=$(find *-artifact-* -type f | paste -sd' ')
70+
gh release create continuous-${{ steps.git_info.outputs.latest_tag }}-rev${{ steps.git_info.outputs.rev_count }} $files_list --prerelease \
71+
--title 'ZeGrapher continuous build ${{ steps.git_info.outputs.latest_tag }}' \
72+
if: steps.git_info.outputs.rev_count != 0

.github/workflows/linux-build-bundle.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: linux build & bundle
22
on:
3-
workflow_dispatch:
3+
workflow_call:
44

55
jobs:
66
build-bundle:
@@ -11,6 +11,8 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v5
14+
with:
15+
fetch-depth: 0
1416

1517
- name: Install Qt
1618
uses: jurplel/install-qt-action@v4
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
name: macOS build & bundle
22
on:
3-
workflow_dispatch:
3+
workflow_call:
4+
inputs:
5+
runner:
6+
required: true
7+
type: string
8+
49

510
jobs:
611
build-bundle:
7-
runs-on: macos-15-intel
12+
runs-on: ${{ inputs.runner }}
813
defaults:
914
run:
1015
shell: bash
1116
steps:
1217
- name: Checkout
1318
uses: actions/checkout@v5
19+
with:
20+
fetch-depth: 0
1421

1522
- name: Install Dependencies
16-
run: |
17-
brew install boost coreutils qtbase qtsvg qtdeclarative qttools qttranslations meson
23+
run: brew install boost coreutils qtbase qtsvg qtdeclarative qttools qttranslations meson
1824

1925
- name: Select correct Xcode version
2026
run: sudo xcode-select -s /Applications/Xcode_16.4.app
@@ -25,5 +31,5 @@ jobs:
2531
- name: Upload binary artifact
2632
uses: actions/upload-artifact@v5
2733
with:
28-
name: macos-artifact
34+
name: macos-artifact-${{ inputs.runner }}
2935
path: deploy/ZeGrapher*dmg

.github/workflows/windows-build-bundle.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: Windows build & bundle
2+
23
on:
3-
workflow_dispatch:
4-
push:
5-
pull_request:
4+
workflow_call:
5+
inputs:
6+
msystem:
7+
required: true
8+
type: string
69

710
jobs:
811
build-bundle:
@@ -12,10 +15,12 @@ jobs:
1215
shell: msys2 {0}
1316
steps:
1417
- uses: actions/checkout@v5
18+
with:
19+
fetch-depth: 0
1520

1621
- uses: msys2/setup-msys2@v2
1722
with:
18-
msystem: UCRT64
23+
msystem: ${{ inputs.msystem }}
1924
update: true
2025
install: git pactoys
2126

@@ -27,5 +32,5 @@ jobs:
2732
- name: Upload binary artifact
2833
uses: actions/upload-artifact@v5
2934
with:
30-
name: windows-artifact
35+
name: windows-artifact-${{ inputs.msystem }}
3136
path: deploy/ZeGrapher*.exe

0 commit comments

Comments
 (0)