|
35 | 35 | runs-on: ubuntu-20.04 |
36 | 36 | steps: |
37 | 37 | - name: Checkout |
38 | | - uses: actions/checkout@v3 |
| 38 | + uses: actions/checkout@v4 |
| 39 | + with: |
| 40 | + # NOTE: We fetch depth since fetch tags only does not works |
| 41 | + # Sees: https://github.com/actions/checkout/issues/1471 |
| 42 | + fetch-depth: 0 |
39 | 43 | - name: Set up Docker Buildx |
40 | 44 | uses: docker/setup-buildx-action@v2 |
41 | 45 |
|
|
54 | 58 | run: > |
55 | 59 | curl --fail -LO -u ${{ secrets.ARTIFACTS_USER }}:${{ secrets.ARTIFACTS_PASSWORD }} |
56 | 60 | ${{ inputs.artifacts-url || steps.artifacts.outputs.link }}/images/shell-ui.tar.gz |
| 61 | + - name: Retrieve shell archive from artifacts |
| 62 | + run: > |
| 63 | + curl --fail -LO -u ${{ secrets.ARTIFACTS_USER }}:${{ secrets.ARTIFACTS_PASSWORD }} |
| 64 | + ${{ inputs.artifacts-url || steps.artifacts.outputs.link }}/images/shell.tar |
57 | 65 | - name: Load shell-ui image |
58 | 66 | run: docker load < shell-ui.tar.gz |
59 | 67 | - name: Retrieve product.txt from artifacts |
@@ -127,3 +135,26 @@ jobs: |
127 | 135 | docker push --all-tags |
128 | 136 | "${{ env.REGISTRY_HOST }}/${{ env.REGISTRY_PROJECT }}/shell-ui" |
129 | 137 |
|
| 138 | + - name: Get tag message |
| 139 | + if: inputs.is_production |
| 140 | + id: get_tag_message |
| 141 | + # Explicitly fetching tags since checkout fetch-tags does not works well |
| 142 | + # Sees: https://github.com/actions/checkout/issues/1471 |
| 143 | + run: |- |
| 144 | + git fetch --tags |
| 145 | + echo "message<<EOF" >> $GITHUB_OUTPUT |
| 146 | + git tag -l --format='%(contents)' "${{ env.SHELL_UI_VERSION }}" | tail -n +4 >> $GITHUB_OUTPUT |
| 147 | + echo "EOF" >> $GITHUB_OUTPUT |
| 148 | +
|
| 149 | + - uses: softprops/action-gh-release@v2 |
| 150 | + if: inputs.is_production |
| 151 | + with: |
| 152 | + name: Metalk8s ${{ env.SHELL_UI_VERSION }} |
| 153 | + tag_name: ${{ env.SHELL_UI_VERSION }} |
| 154 | + body: ${{ steps.get_tag_message.outputs.message }} |
| 155 | + prerelease: "${{ ! fromJSON(env.IS_STABLE) }}" |
| 156 | + draft: false |
| 157 | + files: | |
| 158 | + shell.tar |
| 159 | + env: |
| 160 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments