From 4aebc66653ba4c0cc12bea0a1976e984c8501132 Mon Sep 17 00:00:00 2001 From: Dorian Garde Date: Mon, 2 Dec 2024 16:47:42 +0100 Subject: [PATCH] 34420_automtic_build --- .github/workflows/build-release.yml | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/build-release.yml diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 0000000..999a8a0 --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,35 @@ +name: Build package +on: + release: + types: [published] + +jobs: + build: + name: Build and Release + runs-on: ubuntu-latest + steps: + - name: 🚚 Get latest code + uses: actions/checkout@v4 + + - name: Setup node version + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + + - name: Install dependencies + run: npm install + + - name: Build project + run: npm run build + + - name: Unzip in Payline folder + run: rm -rf ./payline && mkdir release && unzip woocommerce-gateway-payline.zip -d ./payline + + - name: Repackage + run: zip -r woocommerce-payline_v${{ github.ref_name }}.zip ./payline + + - name: Upload asset using gh CLI + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ZIP_PATH: woocommerce-payline_v${{ github.ref_name }}.zip + run: gh release upload ${{ github.event.release.tag_name }} $ZIP_PATH \ No newline at end of file