|
7 | 7 |
|
8 | 8 | env: |
9 | 9 | GOLANG_VERSION: 1.23.0 |
10 | | - OSQUERY_VERSION: 5.14.1 |
| 10 | + OSQUERY_VERSION: 5.15.0 |
11 | 11 |
|
12 | 12 | jobs: |
13 | 13 | build_and_test: |
14 | 14 | runs-on: ubuntu-22.04 |
15 | 15 | strategy: |
16 | 16 | matrix: |
17 | | - components: ['tls', 'admin', 'api', 'cli'] |
18 | | - goos: ['linux', 'darwin', 'windows'] |
19 | | - goarch: ['amd64', 'arm64'] |
| 17 | + components: ["tls", "admin", "api", "cli"] |
| 18 | + goos: ["linux", "darwin", "windows"] |
| 19 | + goarch: ["amd64", "arm64"] |
20 | 20 | steps: |
21 | 21 | ########################### Checkout code ########################### |
22 | 22 | - name: Checkout code |
|
64 | 64 | create_deb_packages: |
65 | 65 | strategy: |
66 | 66 | matrix: |
67 | | - components: ['tls', 'admin', 'api', 'cli'] |
68 | | - goos: ['linux'] |
69 | | - goarch: ['amd64'] |
| 67 | + components: ["tls", "admin", "api", "cli"] |
| 68 | + goos: ["linux"] |
| 69 | + goarch: ["amd64"] |
70 | 70 | needs: [build_and_test] |
71 | 71 | runs-on: ubuntu-22.04 |
72 | 72 | steps: |
@@ -101,9 +101,9 @@ jobs: |
101 | 101 | runs-on: ubuntu-22.04 |
102 | 102 | strategy: |
103 | 103 | matrix: |
104 | | - components: ['tls', 'admin', 'api', 'cli'] |
105 | | - goos: ['linux'] |
106 | | - goarch: ['amd64', 'arm64'] |
| 104 | + components: ["tls", "admin", "api", "cli"] |
| 105 | + goos: ["linux"] |
| 106 | + goarch: ["amd64", "arm64"] |
107 | 107 | steps: |
108 | 108 | ########################### Checkout code ########################### |
109 | 109 | - name: Checkout code |
@@ -136,54 +136,52 @@ jobs: |
136 | 136 | docker_hub_username: ${{ secrets.DOCKER_HUB_USERNAME }} |
137 | 137 | docker_hub_access_token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} |
138 | 138 |
|
139 | | - |
140 | 139 | push_docker_images: |
141 | | - needs: [create_docker_images] |
142 | | - runs-on: ubuntu-22.04 |
143 | | - strategy: |
144 | | - matrix: |
145 | | - components: ['tls', 'admin', 'api', 'cli'] |
146 | | - steps: |
147 | | - ########################### Get digests from build ########################### |
148 | | - - name: Download digests |
149 | | - uses: actions/download-artifact@v4.1.7 |
150 | | - with: |
151 | | - pattern: digests-osctrl-${{ matrix.components }}-* |
152 | | - merge-multiple: true |
153 | | - path: /tmp/digests |
154 | | - |
155 | | - ########################### Setup Docker ########################### |
156 | | - - name: Set up Docker Buildx |
157 | | - uses: docker/setup-buildx-action@v3.0.0 |
158 | | - |
159 | | - ########################### Add meta data for containers ########################### |
160 | | - - name: Docker meta |
161 | | - id: meta |
162 | | - uses: docker/metadata-action@v5 |
163 | | - with: |
164 | | - images: ${{ secrets.DOCKER_HUB_ORG }}/osctrl-${{ matrix.components }} |
165 | | - labels: | |
166 | | - org.opencontainers.image.title=osctrl-${{ matrix.components }} |
167 | | - tags: | |
168 | | - type=sha,prefix=,format=short |
169 | | - type=match,pattern=v(.*),group=1 |
170 | | -
|
171 | | -
|
172 | | - ########################### Log into Dockerhub ########################### |
173 | | - - name: Login to Docker Hub |
174 | | - uses: docker/login-action@v3.0.0 |
175 | | - with: |
176 | | - username: ${{ secrets.DOCKER_HUB_USERNAME }} |
177 | | - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} |
178 | | - |
179 | | - ########################### Create and push images ########################### |
180 | | - - name: Create manifest list and push |
181 | | - working-directory: /tmp/digests |
182 | | - run: | |
183 | | - docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ |
184 | | - $(printf '${{ secrets.DOCKER_HUB_ORG }}/osctrl-${{ matrix.components }}@sha256:%s ' *) |
185 | | -
|
186 | | - ########################### Inspect new image ########################### |
187 | | - - name: Inspect image |
188 | | - run: | |
189 | | - docker buildx imagetools inspect ${{ secrets.DOCKER_HUB_ORG }}/osctrl-${{ matrix.components }}:${{ steps.meta.outputs.version }} |
| 140 | + needs: [create_docker_images] |
| 141 | + runs-on: ubuntu-22.04 |
| 142 | + strategy: |
| 143 | + matrix: |
| 144 | + components: ["tls", "admin", "api", "cli"] |
| 145 | + steps: |
| 146 | + ########################### Get digests from build ########################### |
| 147 | + - name: Download digests |
| 148 | + uses: actions/download-artifact@v4.1.7 |
| 149 | + with: |
| 150 | + pattern: digests-osctrl-${{ matrix.components }}-* |
| 151 | + merge-multiple: true |
| 152 | + path: /tmp/digests |
| 153 | + |
| 154 | + ########################### Setup Docker ########################### |
| 155 | + - name: Set up Docker Buildx |
| 156 | + uses: docker/setup-buildx-action@v3.0.0 |
| 157 | + |
| 158 | + ########################### Add meta data for containers ########################### |
| 159 | + - name: Docker meta |
| 160 | + id: meta |
| 161 | + uses: docker/metadata-action@v5 |
| 162 | + with: |
| 163 | + images: ${{ secrets.DOCKER_HUB_ORG }}/osctrl-${{ matrix.components }} |
| 164 | + labels: | |
| 165 | + org.opencontainers.image.title=osctrl-${{ matrix.components }} |
| 166 | + tags: | |
| 167 | + type=sha,prefix=,format=short |
| 168 | + type=match,pattern=v(.*),group=1 |
| 169 | +
|
| 170 | + ########################### Log into Dockerhub ########################### |
| 171 | + - name: Login to Docker Hub |
| 172 | + uses: docker/login-action@v3.0.0 |
| 173 | + with: |
| 174 | + username: ${{ secrets.DOCKER_HUB_USERNAME }} |
| 175 | + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} |
| 176 | + |
| 177 | + ########################### Create and push images ########################### |
| 178 | + - name: Create manifest list and push |
| 179 | + working-directory: /tmp/digests |
| 180 | + run: | |
| 181 | + docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ |
| 182 | + $(printf '${{ secrets.DOCKER_HUB_ORG }}/osctrl-${{ matrix.components }}@sha256:%s ' *) |
| 183 | +
|
| 184 | + ########################### Inspect new image ########################### |
| 185 | + - name: Inspect image |
| 186 | + run: | |
| 187 | + docker buildx imagetools inspect ${{ secrets.DOCKER_HUB_ORG }}/osctrl-${{ matrix.components }}:${{ steps.meta.outputs.version }} |
0 commit comments