Skip to content

Commit

Permalink
Use Repo name for release artifact zip
Browse files Browse the repository at this point in the history
  • Loading branch information
smileBeda committed May 23, 2024
1 parent 88ed3e2 commit 03b3a4e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
jobs:
release:
runs-on: ubuntu-latest
env:
REPO_NAME: ${{ github.event.repository.name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -20,11 +22,11 @@ jobs:

- name: Build release package
run: |
mkdir plugin-name
cp -R src/* plugin-name/
sed -i 's|/src/src/|/src/|g' plugin-name/vendor/composer/autoload_classmap.php
sed -i 's|/src/src/|/src/|g' plugin-name/vendor/composer/autoload_static.php
zip -r plugin-name.zip plugin-name/
mkdir $REPO_NAME
cp -R src/* $REPO_NAME/
sed -i 's|/src/src/|/src/|g' $REPO_NAME/vendor/composer/autoload_classmap.php
sed -i 's|/src/src/|/src/|g' $REPO_NAME/vendor/composer/autoload_static.php
zip -r $REPO_NAME.zip $REPO_NAME/
- name: Get the version
id: get_version
Expand All @@ -48,6 +50,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # Use the output from the create_release step
asset_path: ./plugin-name.zip
asset_name: plugin-name.zip
asset_path: ./${{ env.REPO_NAME }}.zip
asset_name: ${{ env.REPO_NAME }}.zip
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ For detailed documentation on the Plugin usage and Development processes, please

_Until Wiki is online_
- to manage and release a plugin with this repo/clone of
- clone/fork this entire repo
- clone/fork this entire repo. Make sure to give the repo the exact name you will want for your _plugin_ (such as `my-awesome-plugin`). The release workflows will use that to zip up your built releases.
- your _plugin_ will be whatever is inside the root `src` folder. The rest of the root content is NOT part of your plugin, but part of your dev env and workflow
- develop your plugin by making changes to anything inside the root `src` folder
- if you need other dependencies add them to the composer file, remove composer lock, and run `composer install`
Expand Down

0 comments on commit 03b3a4e

Please sign in to comment.