TOC: Add ZIP to release | Check with CPCS
In this repository you'll find GitHub workflows that you can use in your projects.
Remember to check Action permissions in your repository under Settings -> Actions -> General screen, you should have "Workflow permissions" -> "Read and write permissions" ticked
This workflow creates and attach to your release a properly crafted ZIP file.
The ZIP file will be called <REPOSITORY-NAME>-<REF-NAME>.zip
(example: doit-v9.0.5.zip
) and expand to a folder called <REPOSITORY-NAME>
(example: doit
).
- In your repo put
add-zip-to-release.yml
into.github/workflows
. - This workflows use your repository name as folder name, so change it if you have to do something more specific.
- Create a
.gitattribute
file on top of your repo to exclude specific files fron your release. As example:.github export-ignore .gitattributes export-ignore mystuff export-ignore .gitignore export-ignore
Follow those steps to release a new version:
-
From your repository go to "Releases".
-
Draft a new release.
-
In the "Choose a tag" dropdown put version number.
-
It will prompt "+ Create new tag: x.x.x on publish". Click on it.
-
Enter a title and a description for your release.
-
Click on publish.
-
Leave the workflow time to run. You'll get the ZIP file attached to the release.
- In your repo put
cpcs.yml
into.github/workflows
. - Edit
cpcs.yml
on line 17 to reflect your Text Domain.sed -i '/MY_DOMAIN/ s//CHANGE-THIS-TO-YOUR-TEXT-DOMAIN/' phpcs.xml ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The workflow is triggered on Pull request creation. You'll see if the test is passing. If it fails you'll see in your PR.
![image](https://private-user-images.githubusercontent.com/29772709/254176463-fd346ca6-39ed-442f-8b83-a7121d1e9a09.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1Nzg4MTYsIm5iZiI6MTczOTU3ODUxNiwicGF0aCI6Ii8yOTc3MjcwOS8yNTQxNzY0NjMtZmQzNDZjYTYtMzllZC00NDJmLThiODMtYTcxMjFkMWU5YTA5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDAwMTUxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWExOWNmZWI3YjEzNDkwNDNiZDg4NDkxNzM4NTRjMmE2MDI0Mzc5MWI1OGQwYTY5MzNiYWE0YjQwMDliM2RiMjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.C1CC5QdOWMqou1jHfKjA8PtQ_-5ZpD1JMX_O_g-RavA)
You can check what is failing from the annotations in "File changed" tab.
![image](https://private-user-images.githubusercontent.com/29772709/254176777-e5cdc13b-c854-4519-84cf-e6e13dd001d4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1Nzg4MTYsIm5iZiI6MTczOTU3ODUxNiwicGF0aCI6Ii8yOTc3MjcwOS8yNTQxNzY3NzctZTVjZGMxM2ItYzg1NC00NTE5LTg0Y2YtZTZlMTNkZDAwMWQ0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDAwMTUxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE1NDFiZjVlZjNmNTU0NzUxOTI4ZmFjODQ3MTZlMDA3OGJlZTY2MTMyNmM1YzRiYmM3MzQzMDVlMGNiNmNmOTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.sbbh0AE25_UASJO0CCmB_1lPE6gRusXVXhpEog1G_Go)
Also in the Action Summary you'll find cpcs
output.
![image](https://private-user-images.githubusercontent.com/29772709/343766650-57d7b4dc-3e35-41f7-9c9c-98efd5a8f908.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1Nzg4MTYsIm5iZiI6MTczOTU3ODUxNiwicGF0aCI6Ii8yOTc3MjcwOS8zNDM3NjY2NTAtNTdkN2I0ZGMtM2UzNS00MWY3LTljOWMtOThlZmQ1YThmOTA4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDAwMTUxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkyNWZiOTdhZTY3MzNjNTdlYWZjMmJlZGIzODY4ZTgxNDFjNDE0ODUyYWMwN2I3NWU2Y2QyYjQzYjIwNmY2NmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.wuObUJnIYjWPWnLu84Zk0FgxIrsYq1pEKqB-7K40oj8)