Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECP-8736] Plugin release to Adobe Marketplace workflow #2394

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/m2-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Plugin release to Adobe Marketplace
run-name: Plugin release V${{inputs.releaseTag}} to Adobe Marketplace

on:
#
# @todo later when we have more confidence, we can uncomment the below lines to enable trigger this flow after rlease
#
# pull_request:
# branches:
# - 'releases/**'
workflow_dispatch:
inputs:
releaseTag:
description: "Release tag"
required: true
default: "develop"
packageName:
description: "Adyen package name"
required: true
default: "adyen/dummy-module"

jobs:
build:
runs-on:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download release files
run: |
wget \
-O .github/workflows/templates/package.zip \
https://github.com/Adyen/adyen-magento2/archive/refs/tags/${{inputs.releaseTag}}.zip

- name: Use Node.js
uses: actions/setup-node@v4
- name: npm install
run: |
npm install -g newman
newman run \
--env-var "APP_KEY=${{secrets.EQP_API_KEY}}" \
--env-var "APP_ID=${{secrets.EQP_API_USER}}" \
--env-var "API_URL=https://commercedeveloper-api.adobe.com" \
--env-var "PACKAGE_SKU=${{inputs.packageName}}" \
--env-var "PACKAGE_VERSION=${{inputs.releaseTag}}" \
--env-var "PACKAGE_FILE=package.zip \
.github/workflows/templates/postman_release_collection.json.json
204 changes: 204 additions & 0 deletions .github/workflows/templates/postman_release_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
{
"info": {
"_postman_id": "d8f3f818-6357-496b-b188-29366ce55c46",
"name": "postman_adope_maketplace_release_collection",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Create session token",
"event": [
{
"listen": "test",
"script": {
"exec": [
"",
"pm.test(\"create session token succesfully\", function () {",
" pm.response.to.have.status(200);",
" var jsonData = pm.response.json();",
" pm.collectionVariables.set(\"TOKEN\", jsonData.ust);",
"});",
""
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "username",
"value": "{{APP_ID}}",
"type": "string"
},
{
"key": "password",
"value": "{{APP_KEY}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"grant_type\": \"session\",\n \"expires_in\": 900\n}\n"
},
"url": {
"raw": "{{API_URL}}/rest/v1/app/session/token",
"host": [
"{{API_URL}}"
],
"path": [
"rest",
"v1",
"app",
"session",
"token"
]
}
},
"response": []
},
{
"name": "Upload release zip file",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Upload release file\", function () {",
" pm.expect(pm.response.code).to.be.eq(200);",
" var jsonData = pm.response.json();",
" ",
" pm.collectionVariables.set(\"FILE_UPLOAD_ID\", jsonData[0].file_upload_id);",
"});",
""
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{TOKEN}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "file[]",
"type": "file",
"src": "package.zip"
}
]
},
"url": {
"raw": "{{API_URL}}/rest/v1/files/uploads",
"host": [
"{{API_URL}}"
],
"path": [
"rest",
"v1",
"files",
"uploads"
]
}
},
"response": []
},
{
"name": "Submit package",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{TOKEN}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "[\n {\n \"action\": {\n \"technical\": \"submit\",\n \"marketing\": \"submit\"\n },\n \"type\": \"extension\",\n \"platform\": \"M2\",\n \"version_compatibility\": [\n {\n \"edition\": \"CE\",\n \"versions\": [\n \"2.4\"\n ]\n },\n {\n \"edition\": \"EE\",\n \"versions\": [\n \"2.4\"\n ]\n },\n {\n \"edition\": \"ECE\",\n \"versions\": [\n \"2.4\"\n ]\n }\n ],\n \"sku\": \"{{PACKAGE_SKU}}\",\n \"name\": \"Adyen Dummy Plugin\",\n \"long_description\": \"<Long description here>\",\n \"version\": \"{{PACKAGE_VERSION}}\",\n \"release_notes\": \"{{RELEASE_NOTES}}\",\n \"artifact\": {\n \"file_upload_id\": \"{{FILE_UPLOAD_ID}}\"\n },\n \"documentation_artifacts\": {\n \"user\": {\n \"file_upload_id\": \"657c5ac160b2b2.30735560.0\"\n },\n \"installation\": {\n \"file_upload_id\": \"657c5b310760b1.63927735.0\"\n },\n \"reference\": {\n \"file_upload_id\": \"657c5aee226c01.99700834.0\"\n }\n },\n \"media_artifacts\": {\n \"icon_image\": [],\n \"gallery_images\": [],\n \"video_urls\": []\n },\n \"pricing_model\": {\n \"pricing_type\": \"one-time\",\n \"payment_period\": 1\n },\n \"prices\": [],\n \"license_type\": \"mit\"\n }\n]",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{API_URL}}/rest/v1/products/packages",
"host": [
"{{API_URL}}"
],
"path": [
"rest",
"v1",
"products",
"packages"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "TOKEN",
"value": "",
"type": "default"
},
{
"key": "FILE_UPLOAD_ID",
"value": "",
"type": "default"
}
]
}