|
5 | 5 | inputs:
|
6 | 6 | binary_version:
|
7 | 7 | description: "Specify the version"
|
8 |
| - required: true |
| 8 | + required: false |
| 9 | + binary_hash: |
| 10 | + description: "Specify the release hash" |
| 11 | + required: false |
9 | 12 | repository_name:
|
10 | 13 | description: "Specify the repository"
|
11 | 14 | required: true
|
|
17 | 20 | - webhook
|
18 | 21 |
|
19 | 22 | env:
|
| 23 | + DEPOT_BINARY_HASH: "${{ inputs.binary_hash }}" |
20 | 24 | DEPOT_BINARY_VERSION: "${{ inputs.binary_version }}"
|
21 | 25 | DEPOT_REPOSITORY_ORG: "${{ inputs.repository_org }}"
|
22 | 26 | DEPOT_REPOSITORY_NAME: "${{ inputs.repository_name }}"
|
@@ -114,16 +118,28 @@ jobs:
|
114 | 118 | name: "Setup builder"
|
115 | 119 | run: bash ./builders/${{ env.DEPOT_BUILDER }}/setup.sh
|
116 | 120 |
|
117 |
| - - id: "clone" |
118 |
| - name: "Clone protocol source" |
| 121 | + - id: "clone-tags" |
| 122 | + name: "Clone protocol source from tags" |
119 | 123 | uses: "actions/checkout@v4"
|
| 124 | + if: "${{ env.DEPOT_BINARY_VERSION != '' }}" |
120 | 125 | with:
|
121 | 126 | repository: "${{ env.DEPOT_REPOSITORY_ORG }}/${{ env.DEPOT_REPOSITORY_NAME }}"
|
122 | 127 | fetch-tags: true
|
123 | 128 | path: "${{ env.DEPOT_PROJECT_NAME }}"
|
124 | 129 | ref: "refs/tags/${{ env.DEPOT_BINARY_VERSION }}"
|
125 | 130 | submodules: true
|
126 | 131 |
|
| 132 | + - id: "clone-ref" |
| 133 | + name: "Clone protocol source from specified reference" |
| 134 | + uses: "actions/checkout@v4" |
| 135 | + if: "${{ env.DEPOT_BINARY_HASH != '' }}" |
| 136 | + with: |
| 137 | + repository: "${{ env.DEPOT_REPOSITORY_ORG }}/${{ env.DEPOT_REPOSITORY_NAME }}" |
| 138 | + path: "${{ env.DEPOT_PROJECT_NAME }}" |
| 139 | + ref: "${{ env.DEPOT_BINARY_HASH }}" |
| 140 | + fetch-depth: 1 |
| 141 | + submodules: true |
| 142 | + |
127 | 143 | - id: "apply-patches"
|
128 | 144 | name: "Apply patches"
|
129 | 145 | if: ${{ needs.outputs.outputs.depot_patches == 'true' }}
|
@@ -182,10 +198,12 @@ jobs:
|
182 | 198 | run: |
|
183 | 199 | set -euo pipefail
|
184 | 200 |
|
| 201 | + VERSION="${DEPOT_BINARY_VERSION:-SHA-$DEPOT_BINARY_HASH}" |
| 202 | +
|
185 | 203 | for file in binaries/*; do
|
186 | 204 | if [ -f "$file" ]; then
|
187 | 205 | filename=$(basename "$file")
|
188 |
| - directory="${{ needs.outputs.outputs.depot_purpose }}/${{ needs.outputs.outputs.depot_project_name }}/${{ env.DEPOT_BINARY_VERSION }}" |
| 206 | + directory="${{ needs.outputs.outputs.depot_purpose }}/${{ needs.outputs.outputs.depot_project_name }}/${VERSION}" |
189 | 207 |
|
190 | 208 | rclone --config="rclone.conf" copy "$file" "r2:${{ env.DEPOT_BUCKET_NAME }}/${directory}"
|
191 | 209 |
|
@@ -219,7 +237,10 @@ jobs:
|
219 | 237 | name: "Set environment variables for Docker"
|
220 | 238 | run: |
|
221 | 239 | echo "DEPOT_PROJECT_NAME=${{ needs.outputs.outputs.depot_project_name }}" >> "${GITHUB_ENV}"
|
222 |
| - echo "DEPOT_BINARY_VERSION=${{ env.DEPOT_BINARY_VERSION }}" >> "${GITHUB_ENV}" |
| 240 | +
|
| 241 | + VERSION="${DEPOT_BINARY_VERSION:-$DEPOT_BINARY_HASH}" |
| 242 | +
|
| 243 | + echo "DEPOT_BINARY_VERSION=${VERSION}" >> "${GITHUB_ENV}" |
223 | 244 |
|
224 | 245 | project_dockerfile="docker/${{ needs.outputs.outputs.depot_project_name }}.Dockerfile"
|
225 | 246 | if [ -f "${project_dockerfile}" ]; then
|
@@ -296,11 +317,6 @@ jobs:
|
296 | 317 | name: "Set project name to envvar"
|
297 | 318 | run: echo "DEPOT_PROJECT_NAME=${{ needs.outputs.outputs.depot_project_name }}" >> "${GITHUB_ENV}"
|
298 | 319 |
|
299 |
| - - id: "envvar-test" |
300 |
| - run: | |
301 |
| - echo ${{ env.DEPOT_PROJECT_NAME }} |
302 |
| - echo ${{ env.DEPOT_BINARY_VERSION }} |
303 |
| -
|
304 | 320 | - id: "checkout"
|
305 | 321 | name: "Checkout code"
|
306 | 322 | uses: actions/checkout@v4
|
|
0 commit comments