Enable multi-platform CI/CD validation for Windows and macOS (#143) #14
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 si-bootstrap-sdk Layer | |
| on: | |
| push: | |
| paths: | |
| - 'layers/si-bootstrap-sdk/**' | |
| - '!layers/si-bootstrap-sdk/README.md' | |
| branches: | |
| - master | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| release-layer: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history to check tags | |
| - name: Get package version and check for changes | |
| id: version_check | |
| run: ./scripts/check-version.sh ./layers/si-bootstrap-sdk si-bootstrap-sdk-v | |
| - name: Set up Docker Buildx | |
| if: steps.version_check.outputs.should_release == 'true' | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Package layer | |
| if: steps.version_check.outputs.should_release == 'true' | |
| working-directory: ./layers/si-bootstrap-sdk | |
| run: ./scripts/package.sh | |
| - name: Verify package created | |
| if: steps.version_check.outputs.should_release == 'true' | |
| working-directory: ./layers/si-bootstrap-sdk | |
| run: | | |
| if [ ! -f "./artifacts/si-bootstrap-sdk.zip" ]; then | |
| echo "Error: Layer package not found" | |
| echo "Contents of ./artifacts:" && ls -la ./artifacts || true | |
| exit 1 | |
| fi | |
| PKG_SIZE=$(du -h ./artifacts/si-bootstrap-sdk.zip | cut -f1) | |
| echo "Package size: $PKG_SIZE" | |
| - name: Install publish script dependencies | |
| if: steps.version_check.outputs.should_release == 'true' | |
| working-directory: ./layers/si-bootstrap-sdk/support/operation-collection | |
| run: npm ci | |
| - name: Publish to Aliyun regions | |
| if: steps.version_check.outputs.should_release == 'true' | |
| id: publish | |
| working-directory: ./layers/si-bootstrap-sdk | |
| env: | |
| ALIYUN_ACCESS_KEY_ID: ${{ secrets.ALIYUN_ACCESS_KEY_ID }} | |
| ALIYUN_ACCESS_KEY_SECRET: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }} | |
| ALIYUN_REGIONS: 'cn-beijing,cn-hangzhou,cn-chengdu,ap-southeast-1' | |
| ALIYUN_COMPATIBLE_RUNTIMES: 'nodejs20,nodejs18,nodejs16' | |
| run: ./scripts/publish-to-regions.sh | |
| - name: Create GitHub Release | |
| if: steps.version_check.outputs.should_release == 'true' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.version_check.outputs.tag_name }} | |
| name: si-bootstrap-sdk Layer ${{ steps.version_check.outputs.version }} | |
| body: | | |
| ## si-bootstrap-sdk Layer Release ${{ steps.version_check.outputs.version }} | |
| ### Layer Information | |
| - **Layer Name**: si-bootstrap-sdk | |
| - **Package Version**: ${{ steps.version_check.outputs.version }} | |
| - **Layer Version**: ${{ steps.publish.outputs.LAYER_VERSION }} | |
| - **Compatible Runtimes**: nodejs20, nodejs18, nodejs16 | |
| - **License**: Apache-2.0 | |
| ### Available Regions | |
| This layer has been published to the following Aliyun regions | |
| with layer version **${{ steps.publish.outputs.LAYER_VERSION }}**: | |
| - **cn-beijing** (Beijing) | |
| - ARN: `acs:fc:cn-beijing:1990893136649406:layers/si-bootstrap-sdk/versions/${{ steps.publish.outputs.LAYER_VERSION }}` | |
| - **cn-hangzhou** (Hangzhou) | |
| - ARN: `acs:fc:cn-hangzhou:1990893136649406:layers/si-bootstrap-sdk/versions/${{ steps.publish.outputs.LAYER_VERSION }}` | |
| - **cn-chengdu** (Chengdu) | |
| - ARN: `acs:fc:cn-chengdu:1990893136649406:layers/si-bootstrap-sdk/versions/${{ steps.publish.outputs.LAYER_VERSION }}` | |
| - **ap-southeast-1** (Singapore) | |
| - ARN: `acs:fc:ap-southeast-1:1990893136649406:layers/si-bootstrap-sdk/versions/${{ steps.publish.outputs.LAYER_VERSION }}` | |
| ### Usage | |
| To use this layer in your Function Compute functions, | |
| reference it by ARN in your function configuration. | |
| ### Changes | |
| See the [commit history](https://github.com/${{ github.repository }}/commits/master/layers/si-bootstrap-sdk) | |
| for details on changes in this release. | |
| draft: false | |
| prerelease: false | |
| files: | | |
| ./layers/si-bootstrap-sdk/artifacts/si-bootstrap-sdk.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |