Commit dbb83135 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Add package build

parent 0274dcab
Loading
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+4 −0
Original line number Diff line number Diff line
/composer.lock
/vendor/

/*.zip
+9 −6
Original line number Diff line number Diff line
# This file is a template, and might need editing before it works on your project.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Composer.gitlab-ci.yml

# Publishes a tag/branch to Composer Packages of the current project
publish:
  image: curlimages/curl:latest
@@ -23,3 +17,12 @@ publish:
        echo "Could not create package - Code $code - $body";
        exit 1;
      fi

build:
  image: composer
  stage: build
  script:
  - composer build
  artifacts:
    paths:
    - "*.zip"

build.sh

0 → 100755
+14 −0
Original line number Diff line number Diff line
#!/bin/sh
set -eux

STAGE_PATH=$(mktemp -d)/${NAME:=wp-test-plugin}
OUTPUT_PATH=$PWD/$NAME.zip

composer install

mkdir "$STAGE_PATH"
cp -r vendor "$STAGE_PATH"
cp *.php "$STAGE_PATH"

cd "$STAGE_PATH/.."
zip -r -9 "$OUTPUT_PATH" "$NAME"
+5 −1
Original line number Diff line number Diff line
{
	"name": "kodo.org.uk/wp-test-plugin",
	"description": "A plugin used to behaviour test WP deployment solutions",
	"type": "wordpress-plugin"
	"type": "wordpress-plugin",

	"scripts": {
		"build": "./build.sh"
	}
}