Skip to content

feat: recursive code checkout on gh ci #5

feat: recursive code checkout on gh ci

feat: recursive code checkout on gh ci #5

Workflow file for this run

name: Release

Check failure on line 1 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

(Line: 83, Col: 17): Unrecognized named-value: 'ZIP'. Located at position 1 within expression: ZIP, (Line: 96, Col: 17): Unrecognized named-value: 'ZIP'. Located at position 1 within expression: ZIP
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: "write"
jobs:
tests:
name: Release tests
runs-on: ubuntu-22
steps:
- uses: "./.github/workflows/tests.yml"
build:
name: Build client
runs-on: ubuntu-latest
container: node:latest
needs: tests
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
- name: Install dependencies
run: npm ci
- name: Replace textdomains
run: find forms-bridge/src -exec sed -i "s/http-bridge/forms-bridge/g" {} \;
- name: Build
run: npm run build
- name: Cleanup
run: rm -rf node_modules
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: client-build
path: forms-bridge/assets
package:
name: Prepare package
runs-on: ubuntu-22
container:
image: codeccoop/wp-cli
env:
ZIP: "${{ github.ref_name }}.zip"
needs: build
steps:
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: client-build
path: forms-bridge/assets
- name: Replace textdomains
run: |
find forms-bridge/plugin -name '*.php' -exec sed -i "s/wpct-plugin/forms-bridge/g" {} \;
find forms-bridge -name '*.php' -exec sed -i "s/wpct_plugin_/forms_bridge_plugin_/g" {} \;
find forms-bridge -name "*.php" -exec sed -i 's/WPCT_PLUGIN/FORMS_BRIDGE\\Common/g' {} \;
find forms-bridge/deps/http -name '*.php' -exec sed -i "s/http-bridge/forms-bridge/g" {} \;
find forms-bridge -name '*.php' -exec sed -i "s/http_bridge_/forms_bridge_http_/g" {} \;
find forms-bridge -name "*.php" -exec sed -i 's/HTTP_BRIDGE_/FORMS_BRIDGE_HTTP_/g' {} \;
find forms-bridge -name '*.php' -exec sed -i 's/HTTP_BRIDGE/FORMS_BRIDGE\\Http/g' {} \;
find forms-bridge/deps/i18n -name '*.php' -exec sed -i "s/wpct-i18n/forms-bridge/g" {} \;
find forms-bridge -name '*.php' -exec sed -i "s/wpct_i18n_/forms_bridge_i18n_/g" {} \;
find forms-bridge -name '*.php' -exec sed -i 's/WPCT_I18N/FORMS_BRIDGE\\I18n/g' {} \;
- name: Archive
run: wp dist-archive forms-bridge ./$ZIP
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: plugin-archive
path: ${{ ZIP }}
release:
name: Release pushed tag
runs-on: ubuntu-22.04
needs: package
env:
ZIP: "${{ github.ref_name }}.zip"
steps:
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: plugin-archive
path: ${{ ZIP }}
- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}
run: |
gh release create "$TAG" \
--repo="$GITHUB_REPOSITORY" \
--title="$TAG" \
--generate-notes \
"$ZIP"