Skip to content

Commit ef14b72

Browse files
Refactor GitHub Actions (the modern way) (#9)
1 parent 40e465d commit ef14b72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+3668
-753
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: 'Setup and build plugin'
2+
description: 'Builds the plugin for specified architecture and build config.'
3+
inputs:
4+
target:
5+
description: 'Build target for dependencies'
6+
required: true
7+
config:
8+
description: 'Build configuration'
9+
required: false
10+
default: 'Release'
11+
additionalParams:
12+
description: 'Additional parameters'
13+
required: false
14+
codesign:
15+
description: 'Enable codesigning (macOS only)'
16+
required: false
17+
default: 'false'
18+
codesignIdent:
19+
description: 'Developer ID for application codesigning (macOS only)'
20+
required: false
21+
default: '-'
22+
visualStudio:
23+
description: 'Visual Studio version (Windows only)'
24+
required: false
25+
default: 'Visual Studio 16 2019'
26+
workingDirectory:
27+
description: 'Working directory for packaging'
28+
required: false
29+
default: ${{ github.workspace }}
30+
runs:
31+
using: 'composite'
32+
steps:
33+
- name: Run macOS Build
34+
if: ${{ runner.os == 'macOS' }}
35+
shell: zsh {0}
36+
env:
37+
CODESIGN_IDENT: ${{ inputs.codesignIdent }}
38+
ADDITIONAL_PARAMS: ${{ inputs.additionalParams }}
39+
run: |
40+
build_args=(
41+
-c ${{ inputs.config }}
42+
-t macos-${{ inputs.target }}
43+
)
44+
45+
if [[ '${{ inputs.codesign }}' == 'true' ]] build_args+=(-s)
46+
if (( ${+CI} && ${+RUNNER_DEBUG} )) build_args+=(--debug)
47+
48+
${{ inputs.workingDirectory }}/.github/scripts/build-macos.zsh ${build_args}
49+
50+
- name: Run Linux Build
51+
if: ${{ runner.os == 'Linux' }}
52+
shell: bash
53+
run: |
54+
build_args=(
55+
-c ${{ inputs.config }}
56+
-t linux-${{ inputs.target }}
57+
)
58+
59+
if [[ -n "${CI}" && -n "${RUNNER_DEBUG}" ]]; then
60+
build_args+=(--debug)
61+
fi
62+
63+
${{ inputs.workingDirectory }}/.github/scripts/build-linux.sh "${build_args[@]}"
64+
65+
- name: Run Windows Build
66+
if: ${{ runner.os == 'Windows' }}
67+
shell: pwsh
68+
run: |
69+
$BuildArgs = @{
70+
Target = '${{ inputs.target }}'
71+
Configuration = '${{ inputs.config }}'
72+
CMakeGenerator = '${{ inputs.visualStudio }}'
73+
}
74+
75+
if ( ( Test-Path env:CI ) -and ( Test-Path env:RUNNER_DEBUG ) ) {
76+
$BuildArgs += @{
77+
Debug = $true
78+
}
79+
}
80+
81+
${{ inputs.workingDirectory }}/.github/scripts/Build-Windows.ps1 @BuildArgs
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: 'Package plugin'
2+
description: 'Packages the plugin for specified architecture and build config.'
3+
inputs:
4+
target:
5+
description: 'Build target for dependencies'
6+
required: true
7+
config:
8+
description: 'Build configuration'
9+
required: false
10+
default: 'Release'
11+
codesign:
12+
description: 'Enable codesigning (macOS only)'
13+
required: false
14+
default: 'false'
15+
notarize:
16+
description: 'Enable notarization (macOS only)'
17+
required: false
18+
default: 'false'
19+
codesignIdent:
20+
description: 'Developer ID for application codesigning (macOS only)'
21+
required: false
22+
default: '-'
23+
installerIdent:
24+
description: 'Developer ID for installer package codesigning (macOS only)'
25+
required: false
26+
default: ''
27+
codesignUser:
28+
description: 'Apple ID username for notarization (macOS only)'
29+
required: false
30+
default: ''
31+
codesignPass:
32+
description: 'Apple ID password for notarization (macOS only)'
33+
required: false
34+
default: ''
35+
createInstaller:
36+
description: 'Create InnoSetup installer (Windows only)'
37+
required: false
38+
default: 'false'
39+
workingDirectory:
40+
description: 'Working directory for packaging'
41+
required: false
42+
default: ${{ github.workspace }}
43+
runs:
44+
using: 'composite'
45+
steps:
46+
- name: Run macOS packaging
47+
if: ${{ runner.os == 'macOS' }}
48+
shell: zsh {0}
49+
env:
50+
CODESIGN_IDENT: ${{ inputs.codesignIdent }}
51+
CODESIGN_IDENT_INSTALLER: ${{ inputs.installerIdent }}
52+
CODESIGN_IDENT_USER: ${{ inputs.codesignUser }}
53+
CODESIGN_IDENT_PASS: ${{ inputs.codesignPass }}
54+
run: |
55+
package_args=(
56+
-c ${{ inputs.config }}
57+
-t macos-${{ inputs.target }}
58+
)
59+
60+
if [[ '${{ inputs.codesign }}' == 'true' ]] package_args+=(-s)
61+
if [[ '${{ inputs.notarize }}' == 'true' ]] package_args+=(-n)
62+
if (( ${+CI} && ${+RUNNER_DEBUG} )) build_args+=(--debug)
63+
64+
${{ inputs.workingDirectory }}/.github/scripts/package-macos.zsh ${package_args}
65+
66+
- name: Run Linux packaging
67+
if: ${{ runner.os == 'Linux' }}
68+
shell: bash
69+
run: |
70+
package_args=(
71+
-c ${{ inputs.config }}
72+
-t linux-${{ inputs.target }}
73+
)
74+
if [[ -n "${CI}" && -n "${RUNNER_DEBUG}" ]]; then
75+
build_args+=(--debug)
76+
fi
77+
78+
${{ inputs.workingDirectory }}/.github/scripts/package-linux.sh "${package_args[@]}"
79+
80+
- name: Run Windows packaging
81+
if: ${{ runner.os == 'Windows' }}
82+
shell: pwsh
83+
run: |
84+
$PackageArgs = @{
85+
Target = '${{ inputs.target }}'
86+
Configuration = '${{ inputs.config }}'
87+
}
88+
89+
if ( '${{ inputs.createInstaller }}' -eq 'true' ) {
90+
$PackageArgs += @{BuildInstaller = $true}
91+
}
92+
93+
if ( ( Test-Path env:CI ) -and ( Test-Path env:RUNNER_DEBUG ) ) {
94+
$BuildArgs += @{
95+
Debug = $true
96+
}
97+
}
98+
99+
${{ inputs.workingDirectory }}/.github/scripts/Package-Windows.ps1 @PackageArgs

.github/scripts/.Aptfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package 'cmake'
2+
package 'ccache'
3+
package 'curl'
4+
package 'git'
5+
package 'jq'
6+
package 'ninja-build', bin: 'ninja'
7+
package 'pkg-config'
8+
package 'clang'
9+
package 'clang-format-13'

.github/scripts/.Brewfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
brew "ccache"
2+
brew "coreutils"
3+
brew "cmake"
4+
brew "git"
5+
brew "jq"
6+
brew "ninja"
7+
brew "flatbuffers"

.github/scripts/.Wingetfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package '7zip.7zip', path: '7-zip', bin: '7z'
2+
package 'cmake', path: 'Cmake\bin', bin: 'cmake'
3+
package 'innosetup', path: 'Inno Setup 6', bin: 'iscc'

0 commit comments

Comments
 (0)