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

[Feature] Creating a GitHub release with plugin assets #8

Closed
shivapoudel opened this issue Apr 2, 2019 · 7 comments
Closed

[Feature] Creating a GitHub release with plugin assets #8

shivapoudel opened this issue Apr 2, 2019 · 7 comments
Assignees
Labels
type:enhancement New feature or request.

Comments

@shivapoudel
Copy link

shivapoudel commented Apr 2, 2019

@helen Currently, I use Mike Jolley's deploy script and it has a cool way to create GitHub release without any assets attached. Thus, during a plugin deployment to WP.org directory, can a feature to create GitHub release with plugin assets included similar to WP.org plugin archive.

Plugin asset is needed because as a file .gitattributes respects export ignorance but while downloading source code zip from release assets filename will be like slug-1.0.0.zip, thus adding up the archive slug.zip to release assets will be of great help.

@shivapoudel shivapoudel changed the title [Feature] Creating a Github release with plugin assets [Feature] Creating a GitHub release with plugin assets Apr 2, 2019
@helen
Copy link
Collaborator

helen commented May 2, 2019

Would this be something specific to WordPress plugins or more of a generic "upload a ZIP file without the tag name" GitHub release helper? I agree that the file naming is an issue, I run into it on a couple of plugins that aren't released on .org, I just wasn't thinking about it here because it's not really WordPress-specific.

@shivapoudel
Copy link
Author

shivapoudel commented May 3, 2019

@helen In our organization, I have to deploy plugins to .org periodically. After a tag has been pushed this action will run and does its task but the real missing thing is Github release. Currently, Mike Jolley's deploy script just create a GitHub release but doesn't attach plugin archive as release assets.

If this action simply had an option to create a release in GitHub or not then that will be much enough. The second important thing why I want plugin archive as release asset is because of a tag name attached for an archive which you have faced too. If this is possible, then it will be a great option for plugin developers.

Automating GitHub and .org release by just creating a tag will be a lifesaver for me :)

@helen
Copy link
Collaborator

helen commented May 14, 2019

I don't think I'm quite following, so please let me know if these are the things you are looking for:

  1. To automatically create a GitHub release upon pushing a tag (as opposed to creating the tag when you create a release in the GitHub UI)
  2. To attach a differently-named ZIP file to the release

If those are accurate, I think the second one is worth looking into, but isn't really WordPress-specific, so I'd want to take a look at whether somebody has already solved that with an Action and then go from there.

@shivapoudel
Copy link
Author

You catch my difficulty so clearly, exactly I was looking for those above mentions points. I would really appreciate if you go through both but I better know you can handle this very nicely for WordPress users.

Additional to this please give a look to this action by lubusIN for the archive action.

For a nerd like me, this will be a lifesaver :)

@shivapoudel
Copy link
Author

@helen any updates in attaching differently-named ZIP file to the release? I found this project was moved to https://github.com/10up/action-wordpress-plugin-deploy

@shivapoudel
Copy link
Author

@helen Can we receive "zip_path" output so we can implement that into upload-release asset action like the below snippet?

name: Deploy to WordPress.org
on:
  release:
    types: [published]
jobs:
  tag:
    name: New tag
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v2
    - name: Build
      run: |
        npm install
        npm run build
    - name: WordPress Plugin Deploy
      id: deploy # ID to supply in other steps.
      uses: 10up/action-wordpress-plugin-deploy@master
      with:
        generate-zip: true # bollean so users with can opt-out of generation zip.
      env:
        SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
        SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
    - name: Upload release asset
      uses: actions/upload-release-asset@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        upload_url: ${{ github.event.release.upload_url }}
        asset_path: ${{ steps.deploy.outputs.zip_path }} # here to implement zip path from deploy action.
        asset_name: ${{ github.event.repository.name }}.zip
        asset_content_type: application/zip

This can be received from this bit of code but don't know where to implement in entrypoint.sh file:

if ! $GENERATE_ZIP; then
  echo "Generating zip file..."
  cd "$BUILD_PATH" || exit
  zip -r "${PLUGIN_SLUG}.zip" "$PLUGIN_SLUG/"
  # Set GitHub "zip_path" output
  echo "::set-output name=zip_path::$BUILD_PATH/${PLUGIN_SLUG}.zip"
  echo "Zip file generated!"
fi

@shivapoudel
Copy link
Author

Closed in favor of 10up/action-wordpress-plugin-deploy#37

@jeffpaul jeffpaul removed this from the Future Release milestone Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request.
Projects
None yet
Development

No branches or pull requests

3 participants