This file contains 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: Build and Publish Artifacts | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build bootstrap | |
working-directory: ./bootstrap-go | |
run: ./build.sh | |
env: | |
CGO_ENABLED: 0 | |
- name: Build compute-type-value.js | |
working-directory: ./compute-type-value | |
run: yarn install && yarn build | |
- name: Prepare runtime directory | |
run: | | |
mkdir -p tlrt/runtime | |
curl -O https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz | |
tar -xJf node-v20.18.0-linux-x64.tar.xz --strip-components=1 | |
cp bin/node tlrt/runtime/node | |
cp bootstrap-go/build/bootstrap tlrt/runtime/bootstrap | |
cp compute-type-value/dist/compute-type-value.js tlrt/runtime/compute-type-value.js | |
cp terraform/aws_lambda_layer.tf tlrt/aws_lambda_layer.tf | |
cp terraform/tlrt_sample_index.ts tlrt/tlrt_sample_index.ts | |
cp terraform/tlrt_sample_lambda.tf tlrt/tlrt_sample_lambda.tf | |
- name: Create tar.gz and zip | |
run: | | |
tar -czf tlrt.tar.gz tlrt | |
zip -r tlrt.zip tlrt | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: tlrt-${{ github.run_number }} | |
release_name: tlrt | |
draft: false | |
prerelease: false | |
- name: Upload tar.gz | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./tlrt.tar.gz | |
asset_name: tlrt.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload zip | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./tlrt.zip | |
asset_name: tlrt.zip | |
asset_content_type: application/zip |