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

Use package creation reusable workflow #1625

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from

Conversation

AlexP11223
Copy link
Contributor

@AlexP11223 AlexP11223 commented Aug 25, 2023

Changed the package creation workflow to use the reusable workflow https://github.com/inpsyde/reusable-workflows/blob/main/docs/archive-creation.md

The result should be the same, only now the version is included in the zip name, and there is no prefix. The version input is still checked and the current version from the plugin file is added if numeric version is missing, to keep it more valid and to avoid error during plugin info parsing by dhii/versions. So you can enter pcp-123-some-feature and it will create woocommerce-paypal-payments-2.2.1-pcp-123-some-feature.zip.

Also now the excluded files are in a nicer .distignore file instead of the huge exclude string.

@AlexP11223 AlexP11223 changed the title New package workflow Use package creation reusable workflow Aug 25, 2023
"archive": "zip -r $npm_package_name.zip . -x **.git/\\* **node_modules/\\*",
"postarchive": "yarn run archive:cleanup && rm -rf $npm_package_name && unzip $npm_package_name.zip -d $npm_package_name && rm $npm_package_name.zip && zip -r $npm_package_name.zip $npm_package_name && rm -rf $npm_package_name",
"archive:cleanup": "zip -d $npm_package_name.zip .env* .ddev/\\* \\*.idea/\\* .editorconfig tests/\\* .github/\\* .psalm/\\* wordpress_org_assets/\\* \\*.DS_Store \\*README.md \\*.gitattributes \\*.gitignore \\*composer.json \\*composer.lock patchwork.json phpunit.xml.dist .phpunit.result.cache phpcs.xml* psalm*.xml* playwright.config.js wp-cli.yml \\*.babelrc \\*package.json \\*webpack.config.js \\*yarn.lock \\*.travis.yml\\"
"archive": "wp dist-archive . ./$npm_package_name.zip --plugin-dirname=$npm_package_name"
Copy link
Collaborator

@Biont Biont Aug 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is composer-assets-compiler automatically invoked or does it still(?) go into each module and runs yarn build there?

Copy link
Contributor Author

@AlexP11223 AlexP11223 Aug 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assets compiler is running only in the workflow now. I guess we can replace the install:modules:* and build:modules:* scripts with it but I can't figure out how to setup it properly, e.g. if I run ddev composer compile-assets -vvv again it does not rebuild changes.

    Composer Assets Compiler
    starting...
    
    Not processing 'woocommerce/woocommerce-paypal-payments' because already processed.
    Nothing else to process.
    
    done.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexP11223 You can either pass --ignore-lock and/or specify the source directories so it actually picks up file changes:

https://github.com/inpsyde/composer-asset-compiler/blob/v3.x/docs/007-Hash_and_Lock.md#custom-source-files

Copy link
Contributor Author

@AlexP11223 AlexP11223 Aug 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Biont hm, weird, still the same with --ignore-lock.
And

            "src-paths": [
                "./modules/*/resources/js/*.js",
                "./modules/*/resources/css/*.scss"
            ]

had no effect too 🤔
Only deleting .composer_compiled_assets makes it to rebuild.

btw what was the purpose of --env=root? https://github.com/inpsyde/reusable-workflows/blob/1674a94f9eb5e5572278cef20e305c98440a1df6/.github/workflows/build-plugin-archive.yml#L57C22-L57C32

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexP11223 use --ignore-lock=*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants