|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | | -name: Device 🏗️ Package 🚀 Deploy |
16 | | - |
17 | | -# Builds packages for every device and architecture libhal supports |
| 15 | +name: Package 📦 + 🚀 Deploy |
18 | 16 |
|
19 | 17 | on: |
20 | | - workflow_dispatch: |
21 | 18 | workflow_call: |
22 | 19 | inputs: |
23 | 20 | library: |
24 | | - default: ${{ github.event.repository.name }} |
25 | 21 | type: string |
| 22 | + default: ${{ github.event.repository.name }} |
26 | 23 | repo: |
27 | 24 | type: string |
28 | 25 | default: ${{ github.repository }} |
29 | 26 | conan_version: |
30 | 27 | type: string |
31 | 28 | default: "2.0.14" |
| 29 | + version: |
| 30 | + type: string |
| 31 | + default: "" |
| 32 | + compiler: |
| 33 | + type: string |
| 34 | + required: true |
| 35 | + compiler_version: |
| 36 | + type: string |
| 37 | + required: true |
| 38 | + compiler_package: |
| 39 | + type: string |
| 40 | + required: true |
| 41 | + arch: |
| 42 | + type: string |
| 43 | + required: true |
| 44 | + os: |
| 45 | + type: string |
| 46 | + required: true |
32 | 47 |
|
33 | 48 | jobs: |
34 | | - cortex-m0: |
35 | | - uses: ./.github/workflows/deploy_unit.yml |
36 | | - with: |
37 | | - library: ${{ inputs.library }} |
38 | | - repo: ${{ inputs.repo }} |
39 | | - conan_version: ${{ inputs.conan_version }} |
40 | | - profile: cortex-m0 |
41 | | - profile_source: https://github.com/libhal/libhal-armcortex.git |
42 | | - secrets: inherit |
43 | | - cortex-m1: |
44 | | - uses: ./.github/workflows/deploy_unit.yml |
45 | | - with: |
46 | | - library: ${{ inputs.library }} |
47 | | - repo: ${{ inputs.repo }} |
48 | | - conan_version: ${{ inputs.conan_version }} |
49 | | - profile: cortex-m1 |
50 | | - profile_source: https://github.com/libhal/libhal-armcortex.git |
51 | | - secrets: inherit |
52 | | - cortex-m3: |
53 | | - uses: ./.github/workflows/deploy_unit.yml |
54 | | - with: |
55 | | - library: ${{ inputs.library }} |
56 | | - repo: ${{ inputs.repo }} |
57 | | - conan_version: ${{ inputs.conan_version }} |
58 | | - profile: cortex-m3 |
59 | | - profile_source: https://github.com/libhal/libhal-armcortex.git |
60 | | - secrets: inherit |
61 | | - cortex-m4: |
62 | | - uses: ./.github/workflows/deploy_unit.yml |
63 | | - with: |
64 | | - library: ${{ inputs.library }} |
65 | | - repo: ${{ inputs.repo }} |
66 | | - conan_version: ${{ inputs.conan_version }} |
67 | | - profile: cortex-m4 |
68 | | - profile_source: https://github.com/libhal/libhal-armcortex.git |
69 | | - secrets: inherit |
70 | | - cortex-m4f: |
71 | | - uses: ./.github/workflows/deploy_unit.yml |
72 | | - with: |
73 | | - library: ${{ inputs.library }} |
74 | | - repo: ${{ inputs.repo }} |
75 | | - conan_version: ${{ inputs.conan_version }} |
76 | | - profile: cortex-m4f |
77 | | - profile_source: https://github.com/libhal/libhal-armcortex.git |
78 | | - secrets: inherit |
| 49 | + deploy: |
| 50 | + runs-on: ubuntu-22.04 |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v3 |
| 53 | + if: ${{ inputs.version != '' }} |
| 54 | + with: |
| 55 | + submodules: true |
| 56 | + repository: ${{ inputs.repo }} |
| 57 | + ref: ${{ inputs.version }} |
| 58 | + |
| 59 | + - uses: actions/checkout@v3 |
| 60 | + if: ${{ inputs.version == '' }} |
| 61 | + with: |
| 62 | + submodules: true |
| 63 | + repository: ${{ inputs.repo }} |
| 64 | + |
| 65 | + - name: 📥 Install Conan ${{ inputs.conan_version }} |
| 66 | + run: pip3 install conan==${{ inputs.conan_version }} |
| 67 | + |
| 68 | + - name: 📡 Add `libhal` repo to conan remotes |
| 69 | + run: conan remote add libhal |
| 70 | + https://libhal.jfrog.io/artifactory/api/conan/trunk-conan |
| 71 | + |
| 72 | + - name: 📡 Create and setup default profile |
| 73 | + run: conan profile detect --force |
| 74 | + |
| 75 | + - name: 👁️🗨️ Show conan profile |
| 76 | + run: conan profile show |
| 77 | + |
| 78 | + - name: 📡 Install linux default profiles |
| 79 | + run: conan config install -sf profiles/x86_64/linux/ -tf profiles https://github.com/libhal/conan-config.git |
| 80 | + |
| 81 | + - name: 📡 Sign into JFrog Artifactory |
| 82 | + env: |
| 83 | + PASSWORD: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN }} |
| 84 | + JFROG_USER: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN_USER }} |
| 85 | + run: conan remote login -p $PASSWORD libhal $JFROG_USER |
| 86 | + |
| 87 | + - name: 📡 Install libhal settings_user.yml |
| 88 | + run: conan config install -sf profiles/baremetal/v2 https://github.com/libhal/conan-config.git |
| 89 | + |
| 90 | + - name: Set Version Environment Variable |
| 91 | + run: | |
| 92 | + if [ -z "${{ inputs.version }}" ]; then |
| 93 | + echo "VERSION=latest" >> $GITHUB_ENV |
| 94 | + else |
| 95 | + echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV |
| 96 | + fi |
| 97 | +
|
| 98 | + - name: Create `deploy.profile` |
| 99 | + run: | |
| 100 | + echo "[settings]" > deploy.profile |
| 101 | + echo "arch=${{ inputs.arch }}" >> deploy.profile |
| 102 | + echo "compiler=${{ inputs.compiler }}" >> deploy.profile |
| 103 | + echo "compiler.version=${{ inputs.compiler_version }}" >> deploy.profile |
| 104 | + echo "compiler.libcxx=libstdc++11" >> deploy.profile |
| 105 | + echo "compiler.cppstd=20" >> deploy.profile |
| 106 | + echo "os=${{ inputs.os }}" >> deploy.profile |
| 107 | +
|
| 108 | + - name: Add compiler to `deploy.profile` [tool_requires] section |
| 109 | + if: ${{ inputs.compiler_package != '' }} |
| 110 | + run: | |
| 111 | + echo "[tool_requires]" >> deploy.profile |
| 112 | + echo "${{ inputs.compiler_package }}/${{ inputs.compiler_version }}" >> deploy.profile |
| 113 | +
|
| 114 | + - name: 📦 Create `Debug` package for ${{ inputs.profile }} |
| 115 | + run: conan create . -s build_type=Debug -pr deploy.profile --version=${{ env.VERSION }} |
| 116 | + |
| 117 | + - name: 📦 Create `RelWithDebInfo` package for ${{ inputs.profile }} |
| 118 | + run: conan create . -s build_type=RelWithDebInfo -pr deploy.profile --version=${{ env.VERSION }} |
| 119 | + |
| 120 | + - name: 📦 Create `MinSizeRel` package for ${{ inputs.profile }} |
| 121 | + run: conan create . -s build_type=MinSizeRel -pr deploy.profile --version=${{ env.VERSION }} |
| 122 | + |
| 123 | + - name: 📦 Create `Release` package for ${{ inputs.profile }} |
| 124 | + run: conan create . -s build_type=Release -pr deploy.profile --version=${{ env.VERSION }} |
| 125 | + |
| 126 | + - name: 🆙 Upload package version ${{ inputs.version }} to `libhal` repo |
| 127 | + if: ${{ inputs.version != '' }} |
| 128 | + run: conan upload "${{ inputs.library }}/${{ inputs.version }}" --confirm -r=libhal |
0 commit comments