feat: positional detached synchronization queue #14
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+" | |
| permissions: | |
| contents: "write" | |
| jobs: | |
| tests: | |
| name: Release tests | |
| uses: ./.github/workflows/tests.yml | |
| build: | |
| name: Build client | |
| runs-on: ubuntu-latest | |
| needs: tests | |
| steps: | |
| - name: Setup node | |
| uses: actions/setup-node@v6 | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Cache node modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Replace textdomains | |
| run: find src -exec sed -i "s/http-bridge/posts-bridge/g" {} \; | |
| - name: Build | |
| run: npm run build | |
| - name: Upload plugin bundle | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: plugin-bundle | |
| path: posts-bridge/assets/plugin.bundle.js | |
| - name: Package custom blocks | |
| run: zip -r custom-blocks.zip posts-bridge/custom-blocks -x '*/src/*' -x '*/node_modules/*' -x '*/esbuild/*' | |
| - name: Upload custom blocks | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: custom-blocks | |
| path: custom-blocks.zip | |
| package: | |
| name: Prepare package | |
| runs-on: ubuntu-latest | |
| container: | |
| image: codeccoop/wp-cli | |
| env: | |
| ZIP: "${{ github.ref_name }}.zip" | |
| needs: build | |
| steps: | |
| - name: Setup node | |
| uses: actions/setup-node@v6 | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: plugin-bundle | |
| path: posts-bridge/assets | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: custom-blocks | |
| - name: Unpackage custom blocks | |
| run: unzip -o custom-blocks.zip | |
| - name: Install dist archive | |
| run: wp package install wp-cli/dist-archive-command:@stable | |
| - name: Replace textdomains | |
| run: | | |
| find posts-bridge/deps/plugin -name '*.php' -exec sed -i "s/wpct-plugin/posts-bridge/g" {} \; | |
| find posts-bridge -name '*.php' -exec sed -i "s/wpct_plugin_/posts_bridge_plugin_/g" {} \; | |
| find posts-bridge -name "*.php" -exec sed -i 's/WPCT_PLUGIN/POSTS_BRIDGE\\Plugin/g' {} \; | |
| find posts-bridge/deps/http -name '*.php' -exec sed -i "s/http-bridge/posts-bridge/g" {} \; | |
| find posts-bridge -name '*.php' -exec sed -i "s/http_bridge_/posts_bridge_http_/g" {} \; | |
| find posts-bridge -name "*.php" -exec sed -i 's/HTTP_BRIDGE_/POSTS_BRIDGE_HTTP_/g' {} \; | |
| find posts-bridge -name '*.php' -exec sed -i 's/HTTP_BRIDGE/POSTS_BRIDGE\\Http/g' {} \; | |
| - name: Distignore | |
| run: cp .distignore posts-bridge | |
| - name: Archive | |
| run: wp dist-archive posts-bridge ./"$ZIP" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: plugin-archive | |
| path: ${{ env.ZIP }} | |
| release: | |
| name: Release pushed tag | |
| runs-on: ubuntu-latest | |
| needs: package | |
| env: | |
| ZIP: "${{ github.ref_name }}.zip" | |
| steps: | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: plugin-archive | |
| - name: Create release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG: ${{ github.ref_name }} | |
| run: | | |
| mv $ZIP posts-bridge.zip | |
| gh release create "$TAG" \ | |
| --repo="$GITHUB_REPOSITORY" \ | |
| --title="$TAG" \ | |
| --generate-notes \ | |
| "posts-bridge.zip" |