Skip to content

fix: add recursive flag to zip #8

fix: add recursive flag to zip

fix: add recursive flag to zip #8

name: Generate output for download
on:
push:
branches:
- main
workflow_dispatch:
jobs:
draft_release:
permissions:
contents: write
name: Create Draft Release
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.create_release.outputs.id }}
release_version: ${{ steps.tag.outputs.new_tag }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
semver_commit_hash: ${{ steps.semver_commit.outputs.commit_hash }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Bump version and push tag
id: tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: "minor"
- name: Bump package.json version
id: npm-version
uses: reedyuk/npm-version@master
with:
version: ${{ steps.tag.outputs.new_version }}
- name: Commit semver changes to repo
id: semver_commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
tag_name: ${{ steps.tag.outputs.new_tag }}
name: ${{ steps.tag.outputs.new_tag }}
body: ${{ steps.tag.outputs.changelog }}
draft: true
prerelease: false
generate_output:
needs: [draft_release]
name: Gather plugin code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.draft_release.outputs.semver_commit_hash }}
- name: Set up NodeJS
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Get Repository Name
id: repo-name
uses: MariachiBear/[email protected]
- name: Check for files
run: ls
- name: ZIP up the plugin code
run: zip -j -r ${{ steps.repo-name.outputs.repository-name }}.zip ./*
- name: Upload Output to Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.draft_release.outputs.release_version }}
draft: true
files: ${{ steps.repo-name.outputs.repository-name }}.zip
make_release:
needs: [draft_release, generate_output]
name: Publish the Draft Release
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub Action
uses: actions/checkout@v4
- name: Mark release as published
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.draft_release.outputs.release_id }}