From 8b5cabd0cdb0efb3dfbce7460e7ffab568d3a398 Mon Sep 17 00:00:00 2001 From: Paul Kilmurray Date: Tue, 27 Feb 2024 21:28:22 +0100 Subject: [PATCH] Create manual-release.yml --- .github/workflows/manual-release.yml | 57 ++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/manual-release.yml diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml new file mode 100644 index 0000000..ff96ee1 --- /dev/null +++ b/.github/workflows/manual-release.yml @@ -0,0 +1,57 @@ +name: Manual Release + +on: + workflow_dispatch: + inputs: + releaseVersion: + description: 'Release Version' + required: true + default: '0.0.0' + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Release Version + run: echo "VERSION=${{ github.event.inputs.releaseVersion }}" >> $GITHUB_ENV + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ env.VERSION }} + release_name: Release v${{ env.VERSION }} + draft: false + prerelease: ${{ contains(env.VERSION, '-beta') }} + + - name: Build + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false + run: | + yarn install + composer prefix-dependencies + composer install --no-dev + yarn build:js + + - name: Sync to Temporary Directory + run: | + mkdir temp_dir + rsync -av --prune-empty-dirs --exclude-from='.distignore' ./ temp_dir/ + + - name: Compress and Upload ZIP + run: | + cd temp_dir + zip -r ../woocommerce-pos.zip . + cd .. + gh release upload v${{ env.VERSION }} woocommerce-pos.zip --clobber + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}