From 57f9d6abea51919297f2fd97b14565b16a994d7d Mon Sep 17 00:00:00 2001 From: Frank419 <136145253+onmyodev@users.noreply.github.com> Date: Thu, 29 Aug 2024 08:02:30 +0800 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..afd89e0 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,30 @@ +name: Generate Installable Plugin or Theme, and Upload as Release Asset +on: + release: + types: [published] +jobs: + build: + name: Upload Release Asset + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: setup git config + run: | + git config user.name "GitHub Actions Bot" + git config user.email "<>" + - name: Create artifact + run : | + git archive -o ${{ github.event.repository.name }}-${{ github.ref_name }}.zip --prefix ${{ github.event.repository.name }}/ HEAD + ls + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ github.event.repository.name }}-${{ github.ref_name }} + path: ${{ github.event.repository.name }}-${{ github.ref_name }}.zip + - name: Upload to release + uses: JasonEtco/upload-to-release@master + with: + args: ${{ github.event.repository.name }}-${{ github.ref_name }}.zip application/zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}