|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - main |
| 7 | + - beta |
7 | 8 |
|
8 | 9 | jobs: |
9 | 10 | getversion: |
|
12 | 13 | outputs: |
13 | 14 | shouldBuild: ${{ steps.determineVersion.outputs.shouldBuild }} |
14 | 15 | version: ${{ steps.determineVersion.outputs.version }} |
| 16 | + coreLabels: ${{ steps.setLabels.outputs.core }} |
| 17 | + agentLabels: ${{ steps.setLabels.outputs.agent }} |
15 | 18 | steps: |
16 | 19 | - name: Checkout repo |
17 | 20 | uses: actions/checkout@v2 |
|
35 | 38 | echo "::set-output name=version::$(cat .VERSION)" |
36 | 39 | echo "Determined next version to be: $(cat .VERSION)" |
37 | 40 |
|
| 41 | + |
| 42 | + - name: Set Labels |
| 43 | + id: setLabels |
| 44 | + run: | |
| 45 | + if [[ $REF == "refs/heads/main" ]]; then |
| 46 | + echo "::set-output name=core::plugsy/core:${{ steps.determineVersion.outputs.version }},plugsy/core:latest" |
| 47 | + echo "::set-output name=agent::plugsy/agent:${{ steps.determineVersion.outputs.version }},plugsy/agent:latest" |
| 48 | + else |
| 49 | + echo "::set-output name=core::plugsy/core:${{ steps.determineVersion.outputs.version }}" |
| 50 | + echo "::set-output name=agent::plugsy/agent:${{ steps.determineVersion.outputs.version }}" |
| 51 | + fi |
| 52 | + env: |
| 53 | + REF: ${{ github.ref }} |
| 54 | + |
38 | 55 | buildcore: |
39 | 56 | needs: getversion |
40 | 57 | name: "Build Release Core" |
@@ -75,10 +92,11 @@ jobs: |
75 | 92 | - name: Build and push |
76 | 93 | uses: docker/build-push-action@v2 |
77 | 94 | with: |
| 95 | + platforms: linux/amd64,linux/arm64 |
78 | 96 | context: . |
79 | 97 | file: packages/core/Dockerfile |
80 | 98 | push: true |
81 | | - tags: plugsy/core:${{ needs.getversion.outputs.version }},plugsy/core:latest |
| 99 | + tags: ${{ needs.getversion.outputs.coreLabels }} |
82 | 100 | cache-from: type=local,src=/tmp/.buildx-cache |
83 | 101 | cache-to: type=local,dest=/tmp/.buildx-cache-new |
84 | 102 | # This ugly bit is necessary if you don't want your cache to grow forever |
@@ -131,10 +149,11 @@ jobs: |
131 | 149 | - name: Build and push |
132 | 150 | uses: docker/build-push-action@v2 |
133 | 151 | with: |
| 152 | + platforms: linux/amd64,linux/arm64,linux/arm/v7 |
134 | 153 | context: . |
135 | 154 | file: packages/agent/Dockerfile |
136 | 155 | push: true |
137 | | - tags: plugsy/agent:${{ needs.getversion.outputs.version }},plugsy/agent:latest |
| 156 | + tags: ${{ needs.getversion.outputs.agentLabels }} |
138 | 157 | cache-from: type=local,src=/tmp/.buildx-cache |
139 | 158 | cache-to: type=local,dest=/tmp/.buildx-cache-new |
140 | 159 | # This ugly bit is necessary if you don't want your cache to grow forever |
@@ -179,6 +198,12 @@ jobs: |
179 | 198 | find: "https:\\/\\/github\\.com\\/plugsy\\/core\\/releases\\/download\\/(.*?)\\/core-config-schema\\.json" |
180 | 199 | replace: "https://github.com/plugsy/core/releases/download/v${{ needs.getversion.outputs.version }}/core-config-schema.json" |
181 | 200 |
|
| 201 | + - name: Find and Replace |
| 202 | + uses: jacobtomlinson/gha-find-replace@master |
| 203 | + with: |
| 204 | + find: "https:\\/\\/github\\.com\\/plugsy\\/core\\/releases\\/download\\/(.*?)\\/agent-config-schema\\.json" |
| 205 | + replace: "https://github.com/plugsy/core/releases/download/v${{ needs.getversion.outputs.version }}/agent-config-schema.json" |
| 206 | + |
182 | 207 | - name: Create Pull Request with updated package files |
183 | 208 | uses: peter-evans/create-pull-request@v3 |
184 | 209 | with: |
|
0 commit comments