ci: run shopware-cli jobs in the official Docker image
Replaces the curl/tar install and setup-node steps; the image ships the CLI plus its PHP/Node toolchain. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1ec194b464
commit
c3b242675e
2 files changed
+17
-30
No files matched your search
@@ -1,7 +1,7 @@
|
||||
name: plugin-checks
|
||||
|
||||
# Plugin-agnostic: nothing below names this plugin. Name, version and paths come from composer.json.
|
||||
# shopware-cli is intentionally unpinned (latest); a red build after a CLI release means fix the config.
|
||||
# shopware-cli runs from its official Docker image, intentionally unpinned (latest); a red build after a CLI release means fix the config.
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -13,37 +13,29 @@ permissions:
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/shopware/shopware-cli:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: Install shopware-cli
|
||||
run: |
|
||||
curl -fsSL --retry 5 --retry-delay 10 -o /tmp/swcli.tgz https://github.com/shopware/shopware-cli/releases/latest/download/shopware-cli_Linux_x86_64.tar.gz
|
||||
tar -xzf /tmp/swcli.tgz -C /tmp shopware-cli
|
||||
sudo install /tmp/shopware-cli /usr/local/bin/shopware-cli || install /tmp/shopware-cli /usr/local/bin/shopware-cli
|
||||
- name: Validate extension
|
||||
run: shopware-cli extension validate .
|
||||
|
||||
package:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/shopware/shopware-cli:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: Install shopware-cli
|
||||
run: |
|
||||
curl -fsSL --retry 5 --retry-delay 10 -o /tmp/swcli.tgz https://github.com/shopware/shopware-cli/releases/latest/download/shopware-cli_Linux_x86_64.tar.gz
|
||||
tar -xzf /tmp/swcli.tgz -C /tmp shopware-cli
|
||||
sudo install /tmp/shopware-cli /usr/local/bin/shopware-cli || install /tmp/shopware-cli /usr/local/bin/shopware-cli
|
||||
- name: Package extension
|
||||
run: shopware-cli extension package . --output-directory .build --filename package.zip --git-commit "$GITHUB_SHA"
|
||||
- name: Validate packaged zip
|
||||
run: shopware-cli extension validate .build/package.zip
|
||||
- name: Ensure helper tools (jq, curl, unzip)
|
||||
run: |
|
||||
command -v jq >/dev/null && command -v curl >/dev/null && command -v unzip >/dev/null && exit 0
|
||||
(apt-get update -q && apt-get install -y -q --no-install-recommends jq curl unzip) || apk add --no-cache jq curl unzip
|
||||
- name: Assert built JS is in the zip
|
||||
run: |
|
||||
set -e
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: release
|
||||
|
||||
# Plugin-agnostic: owner, repo, host, package name and version come from the `github` context
|
||||
# and composer.json. shopware-cli is intentionally unpinned (latest).
|
||||
# and composer.json. shopware-cli runs from its official Docker image, intentionally unpinned (latest).
|
||||
# RELEASE_TOKEN is the single token used for releases, assets and the Composer registry.
|
||||
|
||||
on:
|
||||
@@ -15,7 +15,14 @@ permissions:
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/shopware/shopware-cli:latest
|
||||
steps:
|
||||
- name: Ensure helper tools (jq, curl, unzip, git)
|
||||
run: |
|
||||
command -v jq >/dev/null && command -v curl >/dev/null && command -v unzip >/dev/null && command -v git >/dev/null && exit 0
|
||||
(apt-get update -q && apt-get install -y -q --no-install-recommends jq curl unzip git) || apk add --no-cache jq curl unzip git
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
@@ -42,18 +49,6 @@ jobs:
|
||||
echo "skip=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
if: steps.meta.outputs.skip == 'false'
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install shopware-cli
|
||||
if: steps.meta.outputs.skip == 'false'
|
||||
run: |
|
||||
curl -fsSL --retry 5 --retry-delay 10 -o /tmp/swcli.tgz https://github.com/shopware/shopware-cli/releases/latest/download/shopware-cli_Linux_x86_64.tar.gz
|
||||
tar -xzf /tmp/swcli.tgz -C /tmp shopware-cli
|
||||
sudo install /tmp/shopware-cli /usr/local/bin/shopware-cli || install /tmp/shopware-cli /usr/local/bin/shopware-cli
|
||||
|
||||
- name: Validate extension
|
||||
if: steps.meta.outputs.skip == 'false'
|
||||
run: shopware-cli extension validate .
|
||||
|
||||
Reference in new issue
Block a user