Fix apko install URL and Flutter release check in CI pipelines
- apko release assets use lowercase OS and Go arch naming (linux_amd64), but uname returns Linux and x86_64. Map with tr/sed before building the download URL. - Flutter release check used curl -fsSL which fails on 404 when the release doesn't exist yet. Switch to -sS so the step continues and correctly detects new versions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
60d6d3bbec
commit
ee428c1331
@ -42,7 +42,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Install apko
|
- name: Install apko
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL "https://github.com/chainguard-dev/apko/releases/latest/download/apko_$(uname -s)_$(uname -m).tar.gz" | tar xz -C /usr/local/bin apko
|
APKO_OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||||
|
APKO_ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
|
||||||
|
curl -fsSL "https://github.com/chainguard-dev/apko/releases/latest/download/apko_${APKO_OS}_${APKO_ARCH}.tar.gz" | tar xz -C /usr/local/bin apko
|
||||||
|
|
||||||
- name: Login to Docker Registry
|
- name: Login to Docker Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
|
|||||||
@ -34,7 +34,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Install apko
|
- name: Install apko
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL "https://github.com/chainguard-dev/apko/releases/latest/download/apko_$(uname -s)_$(uname -m).tar.gz" | tar xz -C /usr/local/bin apko
|
APKO_OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||||
|
APKO_ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
|
||||||
|
curl -fsSL "https://github.com/chainguard-dev/apko/releases/latest/download/apko_${APKO_OS}_${APKO_ARCH}.tar.gz" | tar xz -C /usr/local/bin apko
|
||||||
|
|
||||||
- name: Login to Docker Registry
|
- name: Login to Docker Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
|
|||||||
@ -52,7 +52,9 @@ jobs:
|
|||||||
- name: Install apko
|
- name: Install apko
|
||||||
if: steps.should_run.outputs.run == 'true'
|
if: steps.should_run.outputs.run == 'true'
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL "https://github.com/chainguard-dev/apko/releases/latest/download/apko_$(uname -s)_$(uname -m).tar.gz" | tar xz -C /usr/local/bin apko
|
APKO_OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||||
|
APKO_ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
|
||||||
|
curl -fsSL "https://github.com/chainguard-dev/apko/releases/latest/download/apko_${APKO_OS}_${APKO_ARCH}.tar.gz" | tar xz -C /usr/local/bin apko
|
||||||
|
|
||||||
- name: Build image locally
|
- name: Build image locally
|
||||||
if: steps.should_run.outputs.run == 'true'
|
if: steps.should_run.outputs.run == 'true'
|
||||||
|
|||||||
@ -24,7 +24,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Install apko
|
- name: Install apko
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL "https://github.com/chainguard-dev/apko/releases/latest/download/apko_$(uname -s)_$(uname -m).tar.gz" | tar xz -C /usr/local/bin apko
|
APKO_OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||||
|
APKO_ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
|
||||||
|
curl -fsSL "https://github.com/chainguard-dev/apko/releases/latest/download/apko_${APKO_OS}_${APKO_ARCH}.tar.gz" | tar xz -C /usr/local/bin apko
|
||||||
|
|
||||||
- name: Check for Wolfi package updates
|
- name: Check for Wolfi package updates
|
||||||
id: check
|
id: check
|
||||||
@ -83,11 +85,11 @@ jobs:
|
|||||||
echo "Latest Flutter stable: $LATEST"
|
echo "Latest Flutter stable: $LATEST"
|
||||||
echo "new_version=$LATEST" >> "$GITHUB_OUTPUT"
|
echo "new_version=$LATEST" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
# Check if a release with this tag already exists
|
# Check if a release with this tag already exists (use -sS, not -f, so 404 doesn't fail)
|
||||||
EXISTING=$(curl -fsSL \
|
EXISTING=$(curl -sS \
|
||||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/tags/v${LATEST}" \
|
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/tags/v${LATEST}" \
|
||||||
2>/dev/null | jq -r '.tag_name // empty')
|
| jq -r '.tag_name // empty')
|
||||||
|
|
||||||
if [ -n "$EXISTING" ]; then
|
if [ -n "$EXISTING" ]; then
|
||||||
echo "Release v${LATEST} already exists, skipping"
|
echo "Release v${LATEST} already exists, skipping"
|
||||||
@ -120,7 +122,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Install apko
|
- name: Install apko
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL "https://github.com/chainguard-dev/apko/releases/latest/download/apko_$(uname -s)_$(uname -m).tar.gz" | tar xz -C /usr/local/bin apko
|
APKO_OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||||
|
APKO_ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
|
||||||
|
curl -fsSL "https://github.com/chainguard-dev/apko/releases/latest/download/apko_${APKO_OS}_${APKO_ARCH}.tar.gz" | tar xz -C /usr/local/bin apko
|
||||||
|
|
||||||
- name: Login to Docker Registry
|
- name: Login to Docker Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user