From 03b3a4efc1739e557c932e0bde118367ab2067ca Mon Sep 17 00:00:00 2001 From: Beda Schmid Date: Thu, 23 May 2024 16:55:07 +0700 Subject: [PATCH] Use Repo name for release artifact zip --- .github/workflows/release.yml | 16 +++++++++------- README.md | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4d99939..58e317d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -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 diff --git a/README.md b/README.md index 34e6ac2..61568fd 100644 --- a/README.md +++ b/README.md @@ -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`