ci: Fix build script release generation #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Encode and generate new release | |
on: | |
pull_request: | |
types: [closed] | |
branches: [dev] | |
env: | |
PLUGIN_NAME: lkn-orderforms-standard-cart | |
jobs: | |
encode-build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Make plugin root directory | |
working-directory: ${{env.WORK_DIR}} | |
run: "mkdir $PLUGIN_NAME && mv -t ./$PLUGIN_NAME ./css ./img ./includes ./js ./lang *.js *.tpl *.css *.php *.gif *.yaml *.html && find ./${{env.PLUGIN_NAME}} -type f -exec chmod 0644 {} + && find ./${{env.PLUGIN_NAME}} -type d -exec chmod 0755 {} + && ls -lah" | |
- name: Create .zip for source code | |
uses: thedoctor0/zip-release@master | |
with: | |
type: "zip" | |
path: ${{ env.PLUGIN_NAME }} | |
directory: '.' | |
filename: ${{ env.PLUGIN_NAME }}.zip | |
- name: Bump version and push tag | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
custom_tag: "1.1.0" | |
- name: Generate new release with encoded source code | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: ${{ env.PLUGIN_NAME }}.zip | |
token: ${{ secrets.GITHUB_TOKEN }} | |
draft: true | |
tag: ${{ steps.tag_version.outputs.new_tag }} | |
name: Release ${{ steps.tag_version.outputs.new_tag }} |