From 025db68d9ae28b95bcdfb60a7114b3d877e1a762 Mon Sep 17 00:00:00 2001 From: Justin Hayes Date: Thu, 7 Mar 2024 09:32:47 -0500 Subject: [PATCH 1/2] Add GitHub Release workflow --- .github/workflows/gh-release.yml | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/gh-release.yml diff --git a/.github/workflows/gh-release.yml b/.github/workflows/gh-release.yml new file mode 100644 index 0000000..f215b28 --- /dev/null +++ b/.github/workflows/gh-release.yml @@ -0,0 +1,53 @@ +name: Release WordPress Plugin + +on: + push: + tags: + - 'v*' + +jobs: + prepare-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Zip WordPress Plugin Folder + run: zip -r Timeline-WP-${{ github.ref_name }}.zip ./Timeline-WP/ + + - name: Upload Plugin Zip as artifact + uses: actions/upload-artifact@v2 + with: + name: Timeline-WP-${{ github.ref_name }} + path: ./Timeline-WP-${{ github.ref_name }}.zip + + create-release: + needs: [prepare-release] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Download Plugin Zip artifact + uses: actions/download-artifact@v2 + with: + name: Timeline-WP-${{ github.ref_name }} + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: Timeline-WP ${{ github.ref_name }} + draft: false + prerelease: false + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./Timeline-WP-${{ github.ref_name }}.zip + asset_name: Timeline-WP-${{ github.ref_name }}.zip + asset_content_type: application/zip From 61a9e90997131c203d830e051bb0e065e8dce3be Mon Sep 17 00:00:00 2001 From: Justin Hayes Date: Thu, 7 Mar 2024 09:36:45 -0500 Subject: [PATCH 2/2] Update release settings --- .github/workflows/gh-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gh-release.yml b/.github/workflows/gh-release.yml index f215b28..6abe8cf 100644 --- a/.github/workflows/gh-release.yml +++ b/.github/workflows/gh-release.yml @@ -39,8 +39,8 @@ jobs: with: tag_name: ${{ github.ref_name }} release_name: Timeline-WP ${{ github.ref_name }} - draft: false - prerelease: false + draft: true + prerelease: true - name: Upload Release Asset uses: actions/upload-release-asset@v1