Skip to content

Commit a7d44a0

Browse files
committed
feat: use workflows from la-mw-gh-action repo
fix: change gh toekn name feat: pass secrets to workflows fix: add secrets to gitignroe feat: add variables fix: set Gtest variable
1 parent 8995f8c commit a7d44a0

File tree

4 files changed

+40
-165
lines changed

4 files changed

+40
-165
lines changed

.github/workflows/commit_stage.yml

Lines changed: 7 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -11,86 +11,11 @@ on :
1111
- '**/LICENCE'
1212

1313
jobs:
14-
validate:
15-
runs-on: windows-2022
16-
outputs:
17-
runners: ${{ steps.runners-matrix.outputs.runners }}
18-
steps:
19-
- uses: actions/checkout@v2
20-
with:
21-
submodules: recursive
22-
- name: Install job dependencies
23-
shell: bash
24-
run: |
25-
choco install -y dos2unix jq
26-
curl https://www.kikisoft.com/Hive/clang-format/clang-format-7.0.0-LambdaPatch-windows.exe -o clang-format.exe
27-
ln -s $(pwd)/clang-format.exe /usr/bin/clang-format
14+
commit-stage:
15+
uses: L-Acoustics/la-mw-gh-action/.github/workflows/commit_stage.yml@main
16+
secrets:
17+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
18+
KEYCHAIN_PASSWORD: ${{secrets.KEYCHAIN_PASSWORD}}
19+
APPLE_CERTIFICATES_P12_BASE64_PASSWORD: ${{secrets.APPLE_CERTIFICATES_P12_BASE64_PASSWORD}}
20+
APPLE_CERTIFICATES_P12_BASE64: ${{secrets.APPLE_CERTIFICATES_P12_BASE64}}
2821

29-
- name: Run fix_files
30-
shell: bash {0}
31-
run: |
32-
./scripts/bashUtils/fix_files.sh
33-
34-
- name: Check for changes
35-
shell: bash
36-
run: |
37-
git diff --name-status --exit-code
38-
if [ $? -ne 0 ]; then
39-
echo "Some files need formatting/fixing. Please run the script and commit the changes."
40-
exit 1
41-
fi
42-
- name: prepare-runners-matrix
43-
id: runners-matrix
44-
shell: bash
45-
run: |
46-
macos=$([ ${{vars.BUILD_MACOS}} = "true" ] && jq -n --argjson r '${{vars.RUNNER_LABELS_MACOS}}' '$r' || echo '""')
47-
echo $macos
48-
linux=$([ ${{vars.BUILD_LINUX}} = "true" ] && jq -n --argjson r '${{vars.RUNNER_LABELS_LINUX}}' '$r' || echo '""')
49-
echo $linux
50-
windows=$([ ${{vars.BUILD_WINDOWS}} = "true" ] && jq -n --argjson r '${{vars.RUNNER_LABELS_WINDOWS}}' '$r' || echo '""')
51-
echo $windows
52-
53-
runners=$(jq -n --argjson m "$macos" --argjson l "$linux" --argjson w "$windows" '[$m,$l,$w]' | jq 'del(.[] | select(. == ""))' | tr -d '\n' )
54-
echo $runners
55-
echo "runners=$runners" >> "$GITHUB_OUTPUT"
56-
57-
build-test:
58-
needs: validate
59-
env:
60-
LC_ALL: en_US.UTF-8
61-
62-
strategy:
63-
fail-fast: false
64-
matrix:
65-
config:
66-
- debug
67-
- release
68-
runner-label: ${{ fromJSON(needs.validate.outputs.runners) }}
69-
70-
runs-on: ${{matrix.runner-label}}
71-
steps:
72-
- uses: actions/checkout@v2
73-
with:
74-
submodules: recursive
75-
76-
- uses: L-Acoustics/la-mw-gh-action/.github/actions/la-swig@v0
77-
name: Install custom SWIG
78-
id: la_swig
79-
80-
81-
- name: Configure runner
82-
uses: L-Acoustics/la-mw-gh-action/.github/actions/la-configure-runner@v0
83-
84-
- name: Build and Test Library
85-
uses: L-Acoustics/la-mw-gh-action/.github/actions/la-build@e368cc944233da2d9b61c7bc3e6108cacf20b174
86-
with:
87-
push_bindings: 'false'
88-
GTEST_FILTER: '-MANUAL*'
89-
SWIG_EXEC: ${{steps.la_swig.outputs.swig_exec}}
90-
SWIG_DIR: ${{steps.la_swig.outputs.swig_dir}}
91-
BUILD_DIR: "_build"
92-
include_nuget_la_feed_url: 'false'
93-
CONFIG: ${{matrix.config}}
94-
NUGET_CURRENT_FEED_URL: 'https://nuget.pkg.github.com/L-Acoustics/index.json'
95-
LIB_NAME: "la_networkInterfaceHelper"
96-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/release_stage.yml

Lines changed: 11 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -22,86 +22,14 @@ on:
2222
default: true
2323

2424
jobs:
25-
validate:
26-
runs-on: windows-2022
27-
outputs:
28-
runners: ${{ steps.runners-matrix.outputs.runners }}
29-
steps:
30-
- uses: actions/checkout@v2
31-
with:
32-
submodules: recursive
33-
- name: Install job dependencies
34-
shell: bash
35-
run: |
36-
choco install -y dos2unix
37-
curl https://www.kikisoft.com/Hive/clang-format/clang-format-7.0.0-LambdaPatch-windows.exe -o clang-format.exe
38-
ln -s $(pwd)/clang-format.exe /usr/bin/clang-format
39-
40-
- name: Run fix_files
41-
shell: bash {0}
42-
run: |
43-
./scripts/bashUtils/fix_files.sh
44-
45-
- name: Check for changes
46-
shell: bash
47-
run: |
48-
git diff --name-status --exit-code
49-
if [ $? -ne 0 ]; then
50-
echo "Some files need formatting/fixing. Please run the script and commit the changes."
51-
exit 1
52-
fi
53-
- name: prepare-runners-matrix
54-
id: runners-matrix
55-
shell: bash
56-
run: |
57-
macos=$(([ ${{vars.RELEASE_MACOS}} = "true" ] || [ ${{inputs.RELEASE_MACOS}} = "true" ]) && jq -n --argjson r '${{vars.RUNNER_LABELS_MACOS}}' '$r' || echo '""')
58-
echo $macos
59-
linux=$(([ ${{vars.RELEASE_LINUX}} = "true" ] || [ ${{inputs.RELEASE_LINUX}} = "true" ]) && jq -n --argjson r '${{vars.RUNNER_LABELS_LINUX}}' '$r' || echo '""')
60-
echo $linux
61-
windows=$(([ ${{vars.RELEASE_WINDOWS}} = "true" ] || [ ${{inputs.RELEASE_WINDOWS}} = "true" ]) && jq -n --argjson r '${{vars.RUNNER_LABELS_WINDOWS}}' '$r' || echo '""')
62-
echo $windows
63-
64-
runners=$(jq -n --argjson m "$macos" --argjson l "$linux" --argjson w "$windows" '[$m,$l,$w]' | jq 'del(.[] | select(. == ""))' | tr -d '\n' )
65-
echo $runners
66-
echo "runners=$runners" >> "$GITHUB_OUTPUT"
67-
68-
release:
69-
70-
needs: validate
71-
env:
72-
LC_ALL: en_US.UTF-8
73-
74-
strategy:
75-
fail-fast: false
76-
matrix:
77-
config:
78-
- release
79-
runner-label: ${{ fromJSON(needs.validate.outputs.runners) }}
80-
81-
runs-on: ${{matrix.runner-label}}
82-
steps:
83-
- uses: actions/checkout@v2
84-
with:
85-
submodules: recursive
86-
87-
- uses: L-Acoustics/la-mw-gh-action/.github/actions/la-swig@v0
88-
name: Install custom SWIG
89-
id: la_swig
90-
91-
92-
- name: Configure runner
93-
uses: L-Acoustics/la-mw-gh-action/.github/actions/la-configure-runner@v0
94-
95-
- name: Build, Test, Push Library
96-
uses: L-Acoustics/la-mw-gh-action/.github/actions/la-build@e368cc944233da2d9b61c7bc3e6108cacf20b174
97-
with:
98-
push_bindings: 'true'
99-
GTEST_FILTER: '-MANUAL*'
100-
SWIG_EXEC: ${{steps.la_swig.outputs.swig_exec}}
101-
SWIG_DIR: ${{steps.la_swig.outputs.swig_dir}}
102-
BUILD_DIR: "_build"
103-
include_nuget_la_feed_url: 'false'
104-
CONFIG: ${{matrix.config}}
105-
NUGET_CURRENT_FEED_URL: 'https://nuget.pkg.github.com/L-Acoustics/index.json'
106-
LIB_NAME: "la_networkInterfaceHelper"
107-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
25+
release-stage:
26+
uses: L-Acoustics/la-mw-gh-action/.github/workflows/release_stage.yml@main
27+
with:
28+
release_linux: ${{inputs.release_linux}}
29+
release_windows: ${{inputs.release_windows}}
30+
release_macos: ${{inputs.release_macos}}
31+
secrets:
32+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
33+
KEYCHAIN_PASSWORD: ${{secrets.KEYCHAIN_PASSWORD}}
34+
APPLE_CERTIFICATES_P12_BASE64_PASSWORD: ${{secrets.APPLE_CERTIFICATES_P12_BASE64_PASSWORD}}
35+
APPLE_CERTIFICATES_P12_BASE64: ${{secrets.APPLE_CERTIFICATES_P12_BASE64}}

.github/workflows/variables.env

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# These variables should be set within the repository
2+
# Quotes are need to make them valid JSON
3+
RUNNER_LABELS_WINDOWS='"windows-2022"'
4+
RUNNER_LABELS_MACOS='"macos-14"'
5+
RUNNER_LABELS_LINUX='"ubuntu-22.04"'
6+
7+
RELEASE_MACOS='false'
8+
RELEASE_LINUX='false'
9+
RELEASE_WINDOWS='false'
10+
11+
BUILD_MACOS='true'
12+
BUILD_LINUX='true'
13+
BUILD_WINDOWS='false'
14+
15+
LIB_NAME='la_networkInterfaceHelper'
16+
BUILD_DIR='_build'
17+
18+
MACOS_SIGNING_IDENTITY="L-ACOUSTICS (4WPJ48N2K4)"
19+
GTEST_FILTER='-MANUAL*'
20+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@
1717

1818
# Ignore CMakeUser presets
1919
CMakeUserPresets.json
20+
21+
**/secrets.env

0 commit comments

Comments
 (0)