Skip to content

update artifacts GitHub actions to v4 (#38) #35

update artifacts GitHub actions to v4 (#38)

update artifacts GitHub actions to v4 (#38) #35

on:
workflow_dispatch:
inputs:
release-tag:
type: string
required: true
description: This will be the version of the release, but will also be used as 'tag' for the localstack docker image
push:
paths-ignore:
- ./*.md
- LICENSE
- .circleci/*
- .gitlab-ci.yml
branches:
- main
permissions:
contents: write
name: Create Release
jobs:
release:
name: Create Release for Cloud Pod
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.11
id: setup-python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Set up Project
run: |
pip install -r requirements-dev.txt
- name: Start LocalStack
uses: LocalStack/[email protected]
with:
image-tag: ${{ inputs.release-tag || 'latest'}}
use-pro: 'true'
install-awslocal: 'true'
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
- name: Build lambdas
run: |
bin/build_lambdas.sh
- name: Deploy infrastructure
run: |
deployment/awslocal/deploy.sh
- name: Run Tests
env:
AWS_DEFAULT_REGION: us-east-1
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
run: |
pytest tests
# Not using action as state is not stored as an artifact
- name: Save the Cloud Pod
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
run: |
localstack state export release-pod.zip
- name: Prepare Release Notes
run: |
echo "This release includes the Cloud Pod of the sample created with LocalStack Version \`${{ inputs.release-tag || 'latest'}}\`." > Release.txt
echo "You can download the \`release-pod.zip\` and inject it manually by running \`localstack state import release-pod.zip\`, or use the Cloud Pods Launchpad." >> Release.txt
echo "### Cloud Pods Launchpad" >> Release.txt
echo "You can click the Launchpad to inject the the pod into your running LocalStack instance using the WebUI:" >> Release.txt
echo "[![LocalStack Pods Launchpad](https://localstack.cloud/gh/launch-pod-badge.svg)](https://app.localstack.cloud/launchpad?url=https://github.com/$GITHUB_REPOSITORY/releases/download/${{ inputs.release-tag || 'latest'}}/release-pod.zip)" >> Release.txt
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: "${{ inputs.release-tag || 'latest'}}"
name: "Cloud Pod for LocalStack Version '${{ inputs.release-tag || 'latest'}}'"
body_path: ./Release.txt
files: |
./release-pod.zip