Skip to content

Commit

Permalink
Merge pull request #114 from vmware-labs/slim-flavors
Browse files Browse the repository at this point in the history
WLR simplified build scripts, actions and structure
  • Loading branch information
assambar authored Jul 14, 2023
2 parents 31a0868 + c7dee9a commit 11be424
Show file tree
Hide file tree
Showing 98 changed files with 881 additions and 900 deletions.
68 changes: 13 additions & 55 deletions .github/workflows/build-php.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,67 +12,25 @@ jobs:
strategy:
fail-fast: false
matrix:
# TODO (ereslibre): the PHP cli is conditionally compiled
# because it has the ability to open a listening socket-- only
# supported on wasmedge --. Remove build-php-cli from here and
# make the PHP CLI conditionally compile local server code out
# on all versions.
include:
- name: php-
suffix: ""
flavor: ""
build-php-cli: false
flavor: ["", "-wasmedge", "-slim"]
version: [8.1.11, 8.2.0, 8.2.6]
exclude:
- flavor: "-wasmedge"
version: 8.1.11
- flavor: "-slim"
version: 8.1.11
- name: php-
suffix: ""
flavor: ""
build-php-cli: false
version: 8.2.0
- name: wasmedge-php-
suffix: "-wasmedge"
flavor: ""
build-php-cli: false
version: 8.2.0
- name: php-
suffix: ""
flavor: -slim
build-php-cli: false
version: 8.2.0
- name: php-
suffix: ""
flavor: ""
build-php-cli: false
version: 8.2.6
- name: wasmedge-php-
suffix: "-wasmedge"
flavor: ""
build-php-cli: false
version: 8.2.6
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build PHP
run: make php/${{ matrix.name }}${{ matrix.version }}${{ matrix.flavor }}
- name: Rename `php-cgi.wasm` binary (adding version and flavor)
shell: bash
run: |
sudo mv build-output/php/php-${{ matrix.version }}${{ matrix.flavor }}${{ matrix.suffix }}/bin/php-cgi{${{ matrix.suffix }},-${{ matrix.version }}${{ matrix.suffix }}${{ matrix.flavor }}}.wasm
- name: Rename `php.wasm` binary (CLI) (adding version and flavor)
shell: bash
if: ${{ matrix.build-php-cli }}
run: |
sudo mv build-output/php/php-${{ matrix.version }}${{ matrix.flavor }}${{ matrix.suffix }}/bin/php{${{ matrix.suffix }},-${{ matrix.version }}${{ matrix.suffix }}${{ matrix.flavor }}}.wasm
- name: Upload php-${{ matrix.version }}${{ matrix.suffix }}${{ matrix.flavor }}.wasm artifact
uses: actions/upload-artifact@v3
if: ${{ matrix.build-php-cli }}
with:
name: php-${{ matrix.version }}${{ matrix.suffix }}${{ matrix.flavor }}.wasm
path: build-output/php/php-${{ matrix.version }}${{ matrix.flavor }}${{ matrix.suffix }}/bin/php-${{ matrix.version }}${{ matrix.suffix }}${{ matrix.flavor }}.wasm
if-no-files-found: error
- name: Upload php-cgi-${{ matrix.version }}${{ matrix.suffix }}${{ matrix.flavor }}.wasm artifact
run: make php/v${{ matrix.version }}${{ matrix.flavor }}
- name: Upload php-${{ matrix.version }} assets
uses: actions/upload-artifact@v3
with:
name: php-cgi-${{ matrix.version }}${{ matrix.suffix }}${{ matrix.flavor }}.wasm artifact
path: build-output/php/php-${{ matrix.version }}${{ matrix.flavor }}${{ matrix.suffix }}/bin/php-cgi-${{ matrix.version }}${{ matrix.suffix }}${{ matrix.flavor }}.wasm
name: php-${{ matrix.version }}.zip
path: |
build-output/*.gz
build-output/*.wasm
build-output/*.txt
if-no-files-found: error
28 changes: 7 additions & 21 deletions .github/workflows/build-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,20 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- prefix: ""
suffix: ""
version: "3.11.4"
- prefix: "wasmedge-"
suffix: "-wasmedge"
version: "3.11.4"
- prefix: "aio-"
suffix: "-aio"
version: "3.11.4"
- prefix: "aio-wasmedge-"
suffix: "-aio-wasmedge"
version: "3.11.4"
flavor: ["", "-wasmedge", "-aio", "-aio-wasmedge"]
version: ["3.11.3", "3.11.4"]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build Python
run: make python/${{ matrix.prefix }}v${{ matrix.version }}
- name: Rename artifacts
shell: bash
run: |
sudo mv build-output/python/v${{ matrix.version }}${{ matrix.suffix }}/bin/python{,-${{ matrix.version }}${{ matrix.suffix }}}.wasm
- name: Upload python-${{ matrix.version }}.zip artifact
run: make python/v${{ matrix.version }}${{ matrix.flavor }}
- name: Upload python-${{ matrix.version }} assets
uses: actions/upload-artifact@v3
with:
name: python-${{ matrix.version }}.zip
path: |
build-output/python/v${{ matrix.version }}${{ matrix.suffix }}/bin/python-${{ matrix.version }}${{ matrix.suffix }}.wasm
build-output/python/v${{ matrix.version }}${{ matrix.suffix }}/usr
build-output/*.gz
build-output/*.wasm
build-output/*.txt
if-no-files-found: error
24 changes: 8 additions & 16 deletions .github/workflows/build-ruby.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,19 @@ jobs:
fail-fast: false
matrix:
flavor: ["", "-slim"]
include:
- version: 3.2.0
target_version: 3_2_0
- version: 3.2.2
target_version: 3_2_2
exclude:
- flavor: "-slim"
version: 3.2.2
version: ["3.2.0", "3.2.2"]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build Ruby
run: make ruby/v${{ matrix.target_version }}${{ matrix.flavor }}
- name: Rename artifacts
shell: bash
run: |
sudo mv build-output/ruby/v${{ matrix.target_version }}${{ matrix.flavor }}/bin/ruby{,-${{ matrix.version }}${{ matrix.flavor }}}.wasm
- name: Upload ruby-${{ matrix.version }}${{ matrix.flavor }}.wasm artifact
run: make ruby/v${{ matrix.version }}${{ matrix.flavor }}
- name: Upload ruby-${{ matrix.version }} assets
uses: actions/upload-artifact@v3
with:
name: ruby-${{ matrix.version }}${{ matrix.flavor }}.wasm
path: build-output/ruby/v${{ matrix.target_version }}${{ matrix.flavor }}/bin/ruby-${{ matrix.version }}${{ matrix.flavor }}.wasm
name: ruby-${{ matrix.version }}.zip
path: |
build-output/*.gz
build-output/*.wasm
build-output/*.txt
if-no-files-found: error
140 changes: 23 additions & 117 deletions .github/workflows/release-php.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,120 +10,26 @@ on:
tags:
- php/*
jobs:
release-php:
strategy:
matrix:
# TODO (ereslibre): the PHP cli is conditionally compiled
# because it has the ability to open a listening socket-- only
# supported on wasmedge --. Remove build-php-cli from here and
# make the PHP CLI conditionally compile local server code out
# on all versions.
include:
- name: php-
suffix: ""
flavor: ""
build-php-cli: false
version: 8.1.11
- name: php-
suffix: ""
flavor: ""
build-php-cli: false
version: 8.2.0
- name: wasmedge-php-
suffix: "-wasmedge"
flavor: ""
build-php-cli: true
version: 8.2.0
- name: php-
suffix: ""
flavor: -slim
build-php-cli: false
version: 8.2.0
- name: php-
suffix: ""
flavor: ""
build-php-cli: false
version: 8.2.6
- name: wasmedge-php-
suffix: "-wasmedge"
flavor: ""
build-php-cli: true
version: 8.2.6
runs-on: ubuntu-latest
steps:
- name: Checkout repository
# Only run for the PHP version specified in the git tag.
#
# This if could be moved to the parent `job` section when it's
# supported by GitHub (https://github.com/community/community/discussions/37883)
if: startsWith(github.event.ref, format('refs/tags/php/{0}+', matrix.version))
uses: actions/checkout@v3
- name: Build PHP
# Only run for the PHP version specified in the git tag.
#
# This if could be moved to the parent `job` section when it's
# supported by GitHub (https://github.com/community/community/discussions/37883)
if: startsWith(github.event.ref, format('refs/tags/php/{0}+', matrix.version))
run: make php/${{ matrix.name }}${{ matrix.version }}${{ matrix.flavor }}
- name: Rename CGI release artifacts
# Only run for the PHP version specified in the git tag.
#
# This if could be moved to the parent `job` section when it's
# supported by GitHub (https://github.com/community/community/discussions/37883)
if: startsWith(github.event.ref, format('refs/tags/php/{0}+', matrix.version))
shell: bash
run: |
sudo mv build-output/php/php-${{ matrix.version }}${{ matrix.flavor }}${{ matrix.suffix }}/bin/php-cgi{${{ matrix.suffix }},-${{ matrix.version }}${{ matrix.suffix }}${{ matrix.flavor }}}.wasm
- name: Rename CLI release artifacts
# Only run for the PHP version specified in the git tag.
#
# This if could be moved to the parent `job` section when it's
# supported by GitHub (https://github.com/community/community/discussions/37883)
if: ${{ startsWith(github.event.ref, format('refs/tags/php/{0}+', matrix.version)) && matrix.build-php-cli }}
shell: bash
run: |
sudo mv build-output/php/php-${{ matrix.version }}${{ matrix.flavor }}${{ matrix.suffix }}/bin/php{${{ matrix.suffix }},-${{ matrix.version }}${{ matrix.suffix }}${{ matrix.flavor }}}.wasm
- name: Create release
# Only run for the PHP version specified in the git tag.
#
# This if could be moved to the parent `job` section when it's
# supported by GitHub (https://github.com/community/community/discussions/37883)
if: startsWith(github.event.ref, format('refs/tags/php/{0}+', matrix.version))
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create --generate-notes ${{ github.ref_name }} || true
- name: Append PHP release assets
# Only run for the PHP version specified in the git tag.
#
# This if could be moved to the parent `job` section when it's
# supported by GitHub (https://github.com/community/community/discussions/37883)
if: ${{ startsWith(github.event.ref, format('refs/tags/php/{0}+', matrix.version))}}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} \
build-output/php/php-${{ matrix.version }}${{ matrix.flavor }}${{ matrix.suffix }}/bin/*.wasm
- name: Generate release assets digests
# Only run for the PHP version specified in the git tag.
#
# This if could be moved to the parent `job` section when it's
# supported by GitHub (https://github.com/community/community/discussions/37883)
if: ${{ startsWith(github.event.ref, format('refs/tags/php/{0}+', matrix.version))}}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for asset in build-output/php/php-${{ matrix.version }}${{ matrix.flavor }}${{ matrix.suffix }}/bin/*.wasm; do
sha256sum "$asset" | sudo tee "$asset.sha256sum" > /dev/null
done
- name: Append release assets digests
# Only run for the PHP version specified in the git tag.
#
# This if could be moved to the parent `job` section when it's
# supported by GitHub (https://github.com/community/community/discussions/37883)
if: ${{ startsWith(github.event.ref, format('refs/tags/php/{0}+', matrix.version))}}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} \
build-output/php/php-${{ matrix.version }}${{ matrix.flavor }}${{ matrix.suffix }}/bin/*.sha256sum
build-default:
uses: ./.github/workflows/reusable-build-runtime-flavor.yaml
with:
target-name: "php"
trigger: ${{ github.event.ref }}
flavor: ""
build-wasmedge:
uses: ./.github/workflows/reusable-build-runtime-flavor.yaml
with:
target-name: "php"
trigger: ${{ github.event.ref }}
flavor: "-wasmedge"
build-slim:
uses: ./.github/workflows/reusable-build-runtime-flavor.yaml
with:
target-name: "php"
trigger: ${{ github.event.ref }}
flavor: "-slim"
publish:
uses: ./.github/workflows/reusable-publish-assets.yaml
needs: [build-default, build-wasmedge, build-slim]
with:
target-name: "php"
Loading

0 comments on commit 11be424

Please sign in to comment.